
// Dom ready
$(document).ready(function() {
    
	// Inject empty UL to trigger superfish events on empty top level
	// nav items in order to hide currently active sub-nav on hover
	// must be done before superfish is applied
	$('<ul>').appendTo('ul#nav > li:not(:has(ul))');
	
	// Global navigation effects
	// init Superfish menu plugin
	$('ul#nav').superfish({
		pathClass: 'active',
		speed: 'normal',
		autoArrows: false,
		dropShadows: false
	});
	
	// Wex Logo
	// embed flash via swfobject
	if($('#logo-flash').length) {
		if ($('body').attr('class') == 'home') {
			url = 'index.html';
			swf = 'images/wex_logo.swf';
		} else {
			url = '../index.html';
			swf = '../images/wex_logo.swf';
		}
		var flashvars = { link: url}
    	var params = { wmode: "transparent", quality: "best"}                
    	var attributes = {}
		swfobject.embedSWF(swf, "logo-flash", "183", "175", "9.0.0", false, flashvars, params, attributes);
	}
	
	// Homepage Movie:
	// embed flash via swfobject
	if($('#logo-flash').length) {
    	var flashvars = {}
        var params = { wmode: "transparent", quality: "best"}                
        var attributes = {}
    	swfobject.embedSWF("images/home_banner.swf", "banner-flash", "981", "197", "9.0.0", false, flashvars, params, attributes);
	}
	
	// Home page promos
	// make entire area clickable without extraneous markup
	if($('.promo h2 a').length) {
		$('.promo h2 a').bigTarget({
	      hoverClass: 'promo-hover',
	      clickZone: 'div:eq(0)'
	    });
	}
	
	// FancyZoom software images
	// apply a class of "zoom" to any image link
//	$(document).ready(function() {
//        $('a.zoom').fancybox();
//    });
	
});