
$(document).ready( function() {
    //Turn on Shadowbox
    Shadowbox.init({
        players: ['html', 'iframe']
    });

    //Use GA to track clicks on PDF files
    //http://stackoverflow.com/questions/303956/jquery-select-a-which-href-contains-some-string
    $('a[href$=".pdf"], a[href$=".PDF"]').click(function() {
    	try {
    		pageTracker._trackPageview(this.href);
    	} catch (err) { }
    });


    $('#mainNav li,#hcpNav li').hover(
                   function() {
                       $(this).addClass('hover');
                  }, function() {
                        $(this).removeClass('hover');
                  }
     );

});

//http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=1&postId=1104
//IE6 Background image flickers on hover
if (document.all) {
	try {
		document.execCommand('BackgroundImageCache', false, true);
	} 
	catch (e) {}
}


// hcp-hear-from-the-experts page shadowbox video displays
// rel="shadowbox;width=970;height=384;"
$(document).ready(function() {
$(".sb_rel_hcp_hear_expert, .sb_rel_hear_expert").each(function() {
    //$(this).attr("onclick","javascript:return showHCPHearTheExpertVideo(this);");
    $(this).click(function(event) {
        event.preventDefault();
        event.returnValue = false;

        // open in shadowbox
        Shadowbox.open({
            content:    $(this).attr("href"),
            player:     "iframe",
            title:      "<div class=\"sb-title sb-title-with-nav\">&nbsp;</div><div id=\"shadowbox_nav\"><a class=\"sb_title_nav_close\" onclick=\"Shadowbox.close()\" title=\"Close\">Close <img src=\"/js/shadowbox/resources/close.png\"/></a></div>",
            width:      970,
            height:     384
        });

        // hide footers, the close button moved to title bar
//        $('#sb-info *').each(function(){$(this).hide();});
//        $('#sb-info').hide();

        // cancel link click
        return false;
    });
});
});