/* Nav bar */

// ///* any tag :hover support for IE6 */
// $('.hover_menu').hover(function() {
//     $('.popup', this)[0].style.display = 'block';
// }, function() {
//     $('.popup', this)[0].style.display = 'none';
// });
//


$(document).ready(function(){
        $('#nav-markets').hover(
                function() { $('#markets-popup').css('display', 'block'); },
                function() { $('#markets-popup').css('display', 'none'); });
});


$(function() {

    $('#nav-products').hover(function() {
        $('#products-popup').slideDown("fast");
    }, function() {
        setTimeout(function() {
                $('#products-popup').slideUp("fast");
        }, 300)
    });


    /* Bubbles */
    $('.bubble-hover').each(function() {
        $b = $('#' + this.rel);
        $b.remove().appendTo('body');
        $(this).hover(function(e) {
            $b = $('#' + this.rel);
            $b[0].style.position = 'absolute';
            window_width = $(window).width();
            if ((e.pageX - 60 + $b.width()) > window_width)
                {
                    $b[0].style.left = (window_width - $b.width() - 20) + 'px';
                }
                else
                {
                    $b[0].style.left = (e.pageX - 60) + 'px';
                }
            $b[0].style.top = (e.pageY - 2 - $b.height()) + 'px';
            $('#' + this.rel).show();
        }, function(e) {
            $('#' + this.rel).hide();
        });
    });
});


$(document).ready( function(){$('#newsticker').innerfade({ animationtype: 'fade', speed: 750, timeout: 6000, type: 'random', containerheight: '1em' }); $('#portfolio').innerfade({ speed: 'slow', timeout: 4000, type: 'sequence', containerheight: '220px' }); $('.fade').innerfade({ speed: 'slow', timeout: 1000, type: 'sequence', containerheight: '1.5em' }); } );
