document.domain = "fekkai.com";

function ratingsDisplayed(totalReviewsCount, avgRating, ratingsOnlyReviewCount, recommendPercentage, productID)
{
	if (totalReviewsCount > 0)
	{
	    var bvRevCntr = document.getElementById("BVReviewsContainer");
	    if (bvRevCntr)
	    {
	    	bvRevCntr.style.display = "block";
	    }
	}
	// Other custom items leveraging these values.
	// TODO: insert Web Analytics tracking here

	// bazaarvoice write review (reviewed and not reviewed statuses)
	if($('BVSubmissionURL'))
	{
	    $("BVSubmissionURL")
	    	.setProperties({
				'class': 'writeReview write',
				'rel': 'width:792,height:600',
				'target': '_blank'
			});
	}

	// bazaarvoice write review (not reviewed status), selecting by class as the ID above is dupped
	if($$('a.BVWriteFirstLink')[0] != null) 
	{
		$$("a.BVWriteFirstLink")[0].addClass("writeReview");
		$$("a.BVWriteFirstLink")[0].addClass("write");
	    $$("a.BVWriteFirstLink")[0].setProperty("rel", "width:792,height:600");
	    $$("a.BVWriteFirstLink")[0].setProperty("target", "_blank");
	}

  var read_link = $$(".BVRRRatingSummaryLinkRead a")[0];

	if(read_link != null) // bazaarvoice read review (reviewed status)
	{
	    read_link.addClass("writeReview");
	    read_link.addClass("read");
	    read_link.setProperty("rel", "width:832,height:650");
	    read_link.setProperty("target", "_blank");
	    read_link.setProperty("href", "/source/templates/bazaar-voice-allreviews.php?productID="+productID);
	    read_link.setProperty("text", "Read Reviews");
	}

	//initialize the special MB for BV
	initializeReviewsMB();

}

var reviewsBox = {};

function initializeReviewsMB()
{
	box = new multiBox({
		mbClass: '.writeReview',//class you need to add links that you want to trigger multiBox with (remember and update CSS files)
		container: $(document.body),//where to inject multiBox
		path: './Files/',//path to mp3 and flv players
		useOverlay: true,//use a semi-transparent background. default: false;
		addRollover: true,//add rollover fade to each multibox link
		recalcTop: true,//subtract the height of controls panel from top position
		showControls:false,
		useCloseButton: true
	});
}

//delegate for flash multibox implementation
function reviewsBoxDelegate(element){
	reviewsBox.open($(element));
}
