jQuery(document).ready(function()
{
    jQuery('#goToSite').change(function()
    {
        this.form.submit();

    });

	$('.bannerWrap').show().cycle({
		fx : 'fade',
		timeout : 4000,
		pause: true
	});
	
    jQuery('.contentBox ul.columns3 li .logoBox .imgWrap').each(function()
    {
        // vertically center logo images in 3 column layout templates
        var wrap = jQuery( this );
        var boxH     = jQuery(this.parentNode).height();
        var contentH = wrap.height();

        if (contentH < boxH)
        {
            var offset = Math.floor( (boxH - contentH) / 2 )
            wrap.css('top', offset);
        }

        wrap.css('visibility', 'visible');
    });


    jQuery('.referenceBox').each(function()
    {
        // move reference signature to bottom of reference box
        var box = jQuery(this);
        var minH = parseInt( box.css('min-height') );
        var imagesHeight = box.find('.referenceText').height() + box.find('.referenceSignature').height()

        var diff = minH - imagesHeight;
        if (diff > 0)
        {
            box.find('.referenceText').css('margin-bottom', diff);
        }
        box.find('.referenceSignature').css('visibility', 'visible');

    });

    if (jQuery('body.body-print').size() < 1 )
    {
        /*
        // position path menu overflow image
        var path = jQuery('.pathMenuBox')[0];
        if (path)
        {
            var totalWidth = ( path.offsetWidth > path.scrollWidth) ? path.offsetWidth : path.scrollWidth;

            if (totalWidth > jQuery(path).outerWidth())
            {
                jQuery(path).addClass('pathMenuBoxOverflow');
            }
            else
            {
                jQuery(path).removeClass('pathMenuBoxOverflow');
            }
        }
        */
    }
    else
    {
        if (window.print)
        {
            window.print();
        }
    }

    jQuery('iframe').each(function(){
        var iframe = jQuery(this);
        var src = iframe.attr('src');
        if (src.match(/http:\/\/www.youtube.com\/embed\//))
        {
            src = src.concat('?wmode=opaque');
            iframe.attr('src', src);
        }
    });

});

// pathMenuBoxOverflow

