﻿$(window).scroll(function() {
    moveFlowers();
   });

$(window).bind('resize', function() {
    moveFlowers();
   });

$(document).ready(function() {
    document.getElementById('flower').style.display = 'block';
    moveFlowers();
   });

function moveFlowers() {
    var centerAreaHeight = $('#masterCenterWrapper').height() + 100;
    var docHeight = $(document).height();
    var flowerHeight = $('#flower').height();

    if (centerAreaHeight < docHeight) {
        document.getElementById('flower').style.top = (docHeight - flowerHeight) + 'px';
    } else {
        document.getElementById('flower').style.top = (centerAreaHeight - flowerHeight) + 'px';
    }
}

var publicationCoverageArea = 'area of coverage';

$(document).ready(function(){
	$('.publicationTitle').html( extractName( brandName ) );
    $('.publicationCoverageArea').html(publicationCoverageArea);
    $('.publicationEmail').attr('href', 'mailto:'+publicationEmail)
});

/*$(document).ready(
function (){
	$(".ProgressBarItemCurrent").append("<img src='brandgroup/JPBMD/Images/Furniture/topTabRightCur.gif'>");
	$(".ProgressBarItemUnavailable").append("<img src='brandgroup/JPBMD/Images/Furniture/topTabRightUnavailable.gif'>");
});*/

function extractName(v) {
	if (v.indexOf('|') > -1) {
		return v.substr(0, v.indexOf('|'));
	}
	else {
		return v;
	}
}

/*"<a href='#'></a>"*/