jQuery.noConflict();
jQuery(document).ready(function($)    
    {
    $('#account-center').hide();
    $('#black').hide();
    $('#medfusion').hide();
    $('#medfusionFrame').hide();
    
    
    $('li.account').hover(function()
        {
            $('#account-center:hidden').slideDown("slow");
            $('#account-open').addClass('on');
            return false;
        }, 
            function () {
            $('#account-center').slideUp("slow");
            $('#account-open').removeClass('on');
            return false;
        }
    );
    
    $('#btn-pl').click(function()
        {
            recordOutboundLink('https://www.medfusion.net/secure/portal/index.cfm?fuseaction=home.login&dest=welcome&gid=4621', 'Patient Login');
            //window.location = "https://www.medfusion.net/secure/portal/index.cfm?fuseaction=home.login&dest=welcome&gid=4621";
            //$('#black').fadeIn(100);
            //$('#medfusion').fadeIn(200);
            //$("#medfusionFrame").attr('src', 'https://www.medfusion.net/secure/portal/index.cfm?fuseaction=home.login&dest=welcome&gid=4621');
        }
    );
    
    $('#btn-cym').click(function()
        {
            recordOutboundLink('https://www.medfusion.net/secure/portal/index.cfm?fuseaction=home.login&dest=welcome&gid=4621', 'Check Your Messages');
            //window.location = "https://www.medfusion.net/secure/portal/index.cfm?fuseaction=home.login&dest=welcome&gid=4621";
            //$('#black').fadeIn(100);
            //$('#medfusion').fadeIn(200);
            //$("#medfusionFrame").attr('src', 'https://www.medfusion.net/secure/portal/index.cfm?fuseaction=home.login&dest=welcome&gid=4621');
        }
    );
    
    $('#btn-pyb').click(function()
        {
            recordOutboundLink ('https://www.medfusion.net/secure/portal/index.cfm?fuseaction=paybill.start&gid=4621&muu=5240', 'Pay Your Bill');
            //window.location = "https://www.medfusion.net/secure/portal/index.cfm?fuseaction=paybill.start&gid=4621&muu=5240";
            //$('#black').fadeIn(100);
            //$('#medfusion').fadeIn(200);
            //$("#medfusionFrame").attr('src', 'https://www.medfusion.net/secure/portal/index.cfm?fuseaction=paybill.start&gid=4621&muu=5240');
        }
    );
    
    $('#btn-rapr').click(function()
        {
            recordOutboundLink('https://www.medfusion.net/secure/portal/index.cfm?fuseaction=rxr.start&gid=4621&muu=5240', 'Request A Prescription Refill');
            //window.location = "https://www.medfusion.net/secure/portal/index.cfm?fuseaction=rxr.start&gid=4621&muu=5240";
            //$('#black').fadeIn(100);
            //$('#medfusion').fadeIn(200);
            //$("#medfusionFrame").attr('src', 'https://www.medfusion.net/secure/portal/index.cfm?fuseaction=rxr.start&gid=4621&muu=5240');
        }
    );
    
    $('#btn-aab').click(function()
        {
            recordOutboundLink('https://www.medfusion.net/secure/portal/index.cfm?fuseaction=vov.askadoc&aasid=11150', 'Ask a Biller');
            //window.location = "https://www.medfusion.net/secure/portal/index.cfm?fuseaction=vov.askadoc&aasid=11150";
            //$('#black').fadeIn(100);
            //$('#medfusion').fadeIn(200);
            //$("#medfusionFrame").attr('src', 'https://www.medfusion.net/secure/portal/index.cfm?fuseaction=vov.askadoc&aasid=11150');
        }
    );
    
    $('#btn-ucrf').click(function()
        {
            recordOutboundLink('https://www.medfusion.net/secure/portal/index.cfm?fuseaction=forms.health', 'Update & Complete Registration Forms');
            //window.location = "https://www.medfusion.net/secure/portal/index.cfm?fuseaction=forms.health";
            //$('#black').fadeIn(100);
            //$('#medfusion').fadeIn(200);
            //$("#medfusionFrame").attr('src', 'https://www.medfusion.net/secure/portal/index.cfm?fuseaction=forms.health');
        }
    );
    
    $('#btn-aan').click(function()
        {
            recordOutboundLink('https://www.medfusion.net/secure/portal/index.cfm?fuseaction=vov.askadoc&aasid=11150', 'Ask A Nurse');
            //window.location = "https://www.medfusion.net/secure/portal/index.cfm?fuseaction=vov.askadoc&aasid=11150";
            //$('#black').fadeIn(100);
            //$('#medfusion').fadeIn(200);
            //$("#medfusionFrame").attr('src', 'https://www.medfusion.net/secure/portal/index.cfm?fuseaction=vov.askadoc&aasid=11150');
        }
    );
    
    $('#btn-aan2').click(function()
        {
            recordOutboundLink('https://www.medfusion.net/secure/portal/index.cfm?fuseaction=vov.askadoc&aasid=11150', 'Ask A Nurse');
            //window.location = "https://www.medfusion.net/secure/portal/index.cfm?fuseaction=vov.askadoc&aasid=11150";
            //$('#black').fadeIn(100);
            //$('#medfusion').fadeIn(200);
            //$("#medfusionFrame").attr('src', 'https://www.medfusion.net/secure/portal/index.cfm?fuseaction=vov.askadoc&aasid=11150');
        }
    );
    
    $('#btn-saa').click(function()
        {
            recordOutboundLink('https://www.medfusion.net/secure/portal/index.cfm?fuseaction=home.login&dest=ars&gid=4621', 'Schedule an Appointment');
            //window.location = "https://www.medfusion.net/secure/portal/index.cfm?fuseaction=home.login&dest=ars&gid=4621";
            //$('#black').fadeIn(100);
            //$('#medfusion').fadeIn(200);
            //$("#medfusionFrame").attr('src', 'https://www.medfusion.net/secure/portal/index.cfm?fuseaction=home.login&dest=ars&gid=4621');
        }
    );
    
    $('.schedule-appt').click(function()
        {
            recordOutboundLink('https://www.medfusion.net/secure/portal/index.cfm?fuseaction=home.login&dest=ars&gid=4621', 'Schedule an Appointment');
            //window.location = "https://www.medfusion.net/secure/portal/index.cfm?fuseaction=home.login&dest=ars&gid=4621";
            //$('#black').fadeIn(100);
            //$('#medfusion').fadeIn(200);
            //$("#medfusionFrame").attr('src', 'https://www.medfusion.net/secure/portal/index.cfm?fuseaction=home.login&dest=ars&gid=4621');
        }
    );
    
    $('.ask-nurse').click(function()
        {
            recordOutboundLink('https://www.medfusion.net/secure/portal/index.cfm?fuseaction=vov.askadoc&aasid=11150', 'Ask a Nurse');
            //window.location = "https://www.medfusion.net/secure/portal/index.cfm?fuseaction=vov.askadoc&aasid=11150";
            //$('#black').fadeIn(100);
            //$('#medfusion').fadeIn(200);
            //$("#medfusionFrame").attr('src', 'https://www.medfusion.net/secure/portal/index.cfm?fuseaction=vov.askadoc&aasid=11150');
        }
    );
    
    $('#close').click(function()
        {
            $('#black').hide();
            $('#medfusion').hide();
            $('#medfusionFrame').hide();
        }
    );
});

  function recordOutboundLink(link, category, action) {
    _gat._getTrackerByName()._trackEvent(category, action);
    setTimeout('document.location = "' + link.href + '"', 200);
  }

//function recordOutboundLink(link, category) {
//          try {
//            var myTracker=_gat._getTrackerByName();
//            _gaq.push(['myTracker._trackEvent', ' + category']);
//            setTimeout('document.location = "' + link + '"', 100)
//          }catch(err){}
//        }
