// Fix background image flickering in IE
try {
  document.execCommand('BackgroundImageCache', false, true);
} catch(e) { }

/* begin - Navigation Primary */
var NavigationPrimary = {
  init: function() {    
		var c = this;
		var n = $('#NavigationPrimary');
		
		// Use bgiframe to fix dropdowns over selects if it's available.
		$.fn.bgiframe && $('li', n).bgiframe();

		// Mark parent elements so that we can style them with CSS
		$('> li', n).each(function() { c.markParents(this); });
  	
  	// Use the hoverintent plugin if it's available
  	if ($.fn.hoverIntent)
    {
  	  $('li', n).hoverIntent( {
  	    sensitivity: 1,
  	    over: this.mouseenter,
  	    out: this.mouseleave,
  	    timeout: 100
  	  });
    }
  	else
  	  $('li', n).hover(this.mouseenter, this.mouseleave);
  },
  markParents: function(li) {
    var c = this;
    if ($('> ul', li).size() > 0)
	    $(li).addClass('parent').find('> a').addClass('parent').end().find('> ul li').each( function() { c.markParents(this); });
	},
	mouseenter: function() { $(this).addClass('over').children('a').addClass('over'); },
	mouseleave: function() { $(this).removeClass('over').children('a').removeClass('over'); }
	
};
$(function() { NavigationPrimary.init(); });
/* end - Primary Navigation */

/* Start supporting JS script for Popup Window functionality. */
$(function() {
  $('a[@href^=http://]').popupwindow(); // Fully qualified links
  $('a[@href^=https://]').popupwindow(); // Fully qualified links
  $('a[@href$=.pdf]').popupwindow(); // PDFs by URL  
  $('a.newsletter').popupwindow(); // Duet Beat Newsletters
  $('area.demo').popupwindow(); // Duet Demo
  $('a.demo').popupwindow(); // Duet Demo
  $('a.webcast').popupwindow(); 
});
/* End supporting JS script for Popup Window functionality. */

// IE6 alpha PNG support
// http://www.dillerdesign.com/experiment/DD_belatedPNG/
var DD_belatedPNG;
if (DD_belatedPNG) {
	DD_belatedPNG.fix('.home #Mast #Announcement img, .home #Mast #Announcement');
}