// 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 = $('ul#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 */


function toggledivs() {
  var inc, endInc=arguments.length;
  for (inc=0; inc<endInc; inc+=2) {
    var id = arguments[inc];
    if (arguments[inc+1] == 'none') param = "none";
    else if(arguments[inc+1]=='block') param = "block";
    if (document.layers) document.layers['container'].layers[id].visibility = param;
    else if (document.all) eval("document.all." + id + ".style.display = \"" + param + "\"");
    else if (document.getElementById) eval("document.getElementById(id).style.display = \"" + param + "\"");
  }
}

var HomeFeatures = {
	content: null,
	navigation: null,
	init: function() {
		this.content = $('#FeatureContent');
		this.navigation = $('#FeatureNavigation');
		$('li:gt(0)', this.content).hide();
		$('a', this.navigation).mouseover(HomeFeatures.bannerNavOver);
		$('#Features').mouseout(function() {
			$('li a', HomeFeatures.navigation).removeClass('over');
			$('li:gt(0)', HomeFeatures.content).hide();
			$('li:eq(0)', HomeFeatures.content).show();
		});
	},
	bannerNavOver: function() {
		var $$ = $(this);
		var cssClass = $$.parent().attr('class');
		$$.parents('ul:first').find('a').removeClass('over');
		$$.addClass('over');
		$('li', HomeFeatures.content).hide();
		$('li.' + cssClass, HomeFeatures.content).show();
	}
	
};
$(function() { HomeFeatures.init(); });


/* begin - open new window for external links and pdfs */
	$(function() {
		$('#Wrapper a[@href^=http://]')
			.not($('#Wrapper a[@href^=http://www.exalead.com/software]'))
			.not($('#Wrapper a[@href^=http://fr.exalead.com/software]'))
			.not($('#Wrapper a[@href^=http://es.exalead.com/software]'))
			.not($('#Wrapper a[@href^=http://fr.exalead.com/software]'))
			.not($('a.noPopup'))
			.not($('#Wrapper a[@href$=.pdf]'))
			 // Fully qualified links
		.add($('#Wrapper a[@href^=https://]')) // Secure HTTP connection links
		.add($('#Wrapper a[@href$=.pdf]')) // PDFs by URL
		.add($('#Wrapper a.popup')).popupwindow(); // specific internal links
		
	});
/*end - open new window for external links and pdfs */

function emsupportenterprise () {
document.write(String.fromCharCode(60,97,32,104,114,101,102,61,34,109,97,105,108,116,111,58,117,115,45,115,117,112,112,111,114,116,45,111,110,101,101,110,116,101,114,112,114,105,115,101,64,101,120,97,108,101,97,100,46,99,111,109,34,62,117,115,45,115,117,112,112,111,114,116,45,111,110,101,101,110,116,101,114,112,114,105,115,101,64,101,120,97,108,101,97,100,46,99,111,109,60,47,97,62))
}
function emsupportoem () {
document.write(String.fromCharCode(60,97,32,104,114,101,102,61,34,109,97,105,108,116,111,58,117,115,45,115,117,112,112,111,114,116,45,111,110,101,111,101,109,64,101,120,97,108,101,97,100,46,99,111,109,34,62,117,115,45,115,117,112,112,111,114,116,45,111,110,101,111,101,109,64,101,120,97,108,101,97,100,46,99,111,109,60,47,97,62))
}
