﻿// Using JQuery to create a customized alert window.    
$(document).ready(function() {

    // Turn the MayoClinicMessage div into a JQuery dialog box.
    // If the user clicks Ok, close the dialog box and send them to the Mayo Clinic Site (in a new browser window)
    $('#MayoClinicMessage').dialog({
        dialogClass: "alert",
        autoOpen: false,
        resizable: false,
        width: 650,
        buttons: {
            "Ok": function() {
                $(this).dialog("close");
                window.open("https://www14.mayoclinicembodyhealth.com/index.cfm?redirect=1");
            }
        }
    });
});

// Display the MayoClinicMessage JQuery dialog box. User can click OK to proceed to the Mayo Clinic Site or close the dialog to return.
function linkAlert() {
    $('#MayoClinicMessage').dialog("open");
}

// Google Analytics ( http://www.google.com/analytics/ )
function GoogleAnalytics(category, doctype) {

    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-9376551-1']);
    _gaq.push(['_trackPageview']);

    (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();

    _gaq.push(['_trackEvent', category, doctype]);

}
