/// <reference path="jquery-1.3.2-vsdoc.js" />

// ad rotator
$(function() {
    var selectors = $("#ads .ad");
    var ctrls = $("#ctrl a");
    var randomIndex = Math.floor(selectors.length * Math.random());
    $(selectors.get(randomIndex)).fadeIn("fast");
    $(ctrls.get(randomIndex)).css({ 'background-position': 'bottom left' });

    $("#ctrl a").hover(function() {
        var audience = $("#ads ." + $(this).attr("class"));
        if (audience.attr("style") != "" && audience.is(":hidden")) {
            $(ctrls).css({'background-position' : 'top left'}); 
            $(this).css({ 'background-position': 'bottom left' });
            $("#ads .ad").fadeOut("fast");
            audience.fadeIn("fast");
        }
        return false;
    });
});


// industry menu item 1
var arrows = {
    id: null,
    items: null
};
var products = $("#industrybar .popnav");
$(function() {
    arrows.id = $("#industrybar .p_feature");
    arrows.items = $(arrows.id).find("> .a");
    $(products).mouseleave(function() { $(this).fadeOut(); });
    $(arrows.items).hover(function() {
        var index = $(arrows.items).index(this);
        $(products).eq(index).fadeIn("medium");
    }, function() { });

});

