function ratingsDisplayed(totalReviewsCount, avgRating, ratingsOnlyReviewCount, recommendPercentage, productID) {
	if (totalReviewsCount == 0) {
		var bvRevCntr = document.getElementById("BVReviewsContainer");
		var bvSVPLink = document.getElementById("BVSVPLinkContainer");
		
		document.getElementById('noreviews').style.display = "block";

		if (bvRevCntr) { bvRevCntr.style.display = "none"; }
		if (bvSVPLink) { bvSVPLink.style.display = "none"; }
		$('noreviews').style.display='block';
    }
	var bvTitleElement=$$('.BVRRQuickTakeTitle')[0];
	if(bvTitleElement) {
	    $$('.BVRRQuickTakeTitle')[0].style.color =  collection_color();
	}
	// Other custom items leveraging these values.
	// TODO: insert Web Analytics tracking here
}
function bvShowTab(application, displayCode, subject, deepLinkId) {
	if (application == 'PRR') {
		// put code to open PRR tab here
		tabs.setActiveTab('two');
	} else if (application == 'QA') {
		// put code to open QA tab here
	} else if (application == 'SY') {
		// put code open Stories tab here
	}
}

var tabs;
var tabsLoaded=0;
Event.observe(window,'load',function(){
	setHover();
	tabs=new Control.Tabs('detailTabs',{
		activeClassName:'active'
		,targetRegExp: /#\-?(.+)$/
		,afterChange: function(new_container) {
			if(tabsLoaded>0) {
				window.location.href='#-'+new_container.id;
			}
			tabsLoaded=1;
		}
		,beforeChange: function(old_container,new_container) {
			if(new_container.id[0]=='-') {
				new_container=new_container.id.substr(1);
//			alert(new_container.id);
			}
		}
	});
	
	if ($('moreLink')) {
		Event.observe('moreLink','click',function(){
	//alert(this.getElementsByTagName('img')[0].src);
			if(this.getElementsByTagName('img')[0].src.indexOf('down.png')>0) {
				setTimeout("moreBackground('hide')",200)
			} else {
				setTimeout("moreBackground('show')",200)
			}
			trigger_effect(this,'moreInfo','slide', '/images/product-more-up.png', '/images/product-more-down.png');
		});
	}
	 
	var awards=$$('#awards div.award > a');
	for(a=0;a<awards.length;a++) {
		var hoverBox=$(awards[a].id+'Hover');
		var dimensions = hoverBox.getDimensions();
		hoverBox.style.left=(-dimensions.width)+'px';
		hoverBox.style.top=(($(hoverBox.parentNode).getHeight()-dimensions.height+10)/2)+'px';
		
		Event.observe(awards[a],'mouseenter',function(){
			var hoverBox=$(this.id+'Hover');
			var dimensions = hoverBox.getDimensions();
			hoverBox.style.left=(-dimensions.width)+'px';
			hoverBox.style.top=((hoverBox.parentNode.getHeight()-dimensions.height+10)/2)+'px';
			hoverBox.style.visibility='visible';
		});
		Event.observe(awards[a],'mouseleave',function(){
			var hoverBox=$(this.id+'Hover');
			hoverBox.style.visibility='hidden';
		});
	}
},false);

function moreBackground(showHide) {
	more=$('moreLink').parentNode.parentNode;
	video=$$('#productInfo > .videoCallout')[0];
	if(video) {
		video.style.border='#FFFFFF 1px';
	}
//alert($$('.details .videoCallout').length+' | '+video.className+' | '+showHide);
	if(showHide=='hide') {
		if(video) {
			video.style.visibility='hidden';
		}
		$('shareLinks').style.visibility='hidden';
		$(more).addClassName('expanded')
	} else {
		if(video) {
			video.style.visibility='';
		}
		$('shareLinks').style.visibility='';
		$(more).removeClassName('expanded')
	}
}

GetVideoModal('.videoCallout .videoLink');

