/*
* Main nav menu subnavs
*/
var ir_navHideCountdown;

function ir_showAaNav() {
	//alert('1');
    if (ir_navHideCountdown) { 
		clearTimeout(ir_navHideCountdown); 
		//alert('2');
	}
    $('#aa_nav').show();
	//alert('3');
    if ($.browser.msie) {
        $('select').css('visibility', 'hidden');
		//alert('4');
    }
}
function ir_hideAaNav() {
    $('#aa_nav').hide();
    if ($.browser.msie) {
        $('select').css('visibility', 'visible');
    }
}
function ir_startHideAaNav() {
    ir_navHideCountdown = setTimeout(ir_hideAaNav, 200);
}
var ir_subnavHideCountdown;

function ir_showSubnav() {
    if (ir_subnavHideCountdown) {
		clearTimeout(ir_subnavHideCountdown);
    }
    document.getElementById('store_subnav').style.display = 'block';
    if ($.browser.msie) {
        $('select').css('visibility', 'hidden');
    }
}
function ir_hideSubnav() {
    document.getElementById('store_subnav').style.display = 'none';
    if ($.browser.msie) {
        $('select').css('visibility', 'visible');
    }
}
function ir_startHideSubnav() {
    ir_subnavHideCountdown = setTimeout(ir_hideSubnav, 200);
}
// Code added for the new AV subnav
var ir_avHideCountdown;

function ir_showAvSubnav() {
    if (ir_avHideCountdown) {
		clearTimeout(ir_avHideCountdown);
    }
    document.getElementById('av_subnav').style.display = 'block';
    if ($.browser.msie) {
        $('select').css('visibility', 'hidden');
    }
}
function ir_hideAvSubnav() {
    document.getElementById('av_subnav').style.display = 'none';
    if ($.browser.msie) {
        $('select').css('visibility', 'visible');
    }
}
function ir_startHideAvSubnav() {
    ir_avHideCountdown = setTimeout(ir_hideAvSubnav, 300);
}
// End av code add
/**
* Rollovers simple solution -- rollover img should have class "rollover"
* and id = rollover src
*/

//image swap code
function dj_rollover() {
    var temp = this.src;
    this.src = this.id;
    this.id = temp;
}

function ir_bindRollovers(context) {
    //preload rollover images
    $('img.rollover', context).each(function() {
        var ii = new Image();
        ii.src = this.id;
    });

    //bind image swapping to all images with class "rollover"
    $('img.rollover', context).hover(dj_rollover, dj_rollover);

    //alert('rollovers bound');
}

$(function() {
    //IE DOM ready seems to be firing prematurely...
    if ($.browser.msie) {
		setTimeout(ir_bindRollovers, 900);
		//alert(document.body.getAttribute('onload'));
		
    } else {
		ir_bindRollovers();
    }
});

function killBrightcovePlayback() {
	try {
		callFlash('pauseAd', true); 
		callFlash('stopVideo');
	} catch (err) {
		// do nothing
	}
}