
// Make logo stick to bottom of window if the content is less than full window

function rePositionLogo()
{

	windowHeight = jQuery(window).height();

	contentOffset = jQuery('#content').offset();
	contentHeight = jQuery('#content').height();

	logoDivHeight = jQuery('#m_logo').height();

	newMarginTop = windowHeight - contentOffset.top - contentHeight - logoDivHeight - 5;

	if(newMarginTop > 30) {

		jQuery('#m_logo').css('margin-top', newMarginTop);

	} else {

		jQuery('#m_logo').css('margin-top', 30);

	}

}

function rePositionImages()
{

    titleDivOffset = jQuery('#header .item-title').offset();
    titleDivHeight = jQuery('#header .item-title').height();

    imageDivOffset = jQuery('#right').offset();

    titleDivBottom = titleDivOffset.top + titleDivHeight;

    if(titleDivBottom - imageDivOffset.top + 20 > 0)
    {

        jQuery('#right').css('padding-top', titleDivBottom - imageDivOffset.top + 20);

    }
}

jQuery(document).ready(function(){

	if(jQuery('#front-page-wrapper').length == 0){
		rePositionLogo();
		jQuery(window).resize(rePositionLogo);
	}

	rePositionImages();

});


