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

    if($('BVSubmissionURL') != null)  // bazaarvoice write review (reviewed and not reviewed statuses)
    {

	    $("BVSubmissionURL").addClass("writeReview");
	    $("BVSubmissionURL").addClass("write");

	    $("BVSubmissionURL").setProperty("rel", "width:792,height:600");
	    $("BVSubmissionURL").setProperty("target", "_blank");

    }

    if($$('a.BVWriteFirstLink')[0] != null) // bazaarvoice write review (not reviewed status), selecting by class as the ID above is dupped
    {
    	$$("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");

    }

    if($("BVSummaryReadReviewsLink") != null) // bazaarvoice read review (reviewed status)
    {

	    $("BVSummaryReadReviewsLink").addClass("writeReview");
	    $("BVSummaryReadReviewsLink").addClass("read");
	    $("BVSummaryReadReviewsLink").setProperty("rel", "width:832,height:600");
	    $("BVSummaryReadReviewsLink").setProperty("target", "_blank");
	    $("BVSummaryReadReviewsLink").setProperty("href", "/source/templates/bazaar-voice-allreviews.php?productID="+productID);
	    $("BVSummaryReadReviewsLink").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
			//descClassName: 'multiBoxDesc',//the class name of the description divs
			path: './Files/',//path to mp3 and flv players
			useOverlay: true,//use a semi-transparent background. default: false;
	//		maxSize: {w:600, h:400},//max dimensions (width,height) - set to null to disable resizing
	//		addDownload: true,//do you want the files to be downloadable?
	//		pathToDownloadScript: './Scripts/ForceDownload.asp',//if above is true, specify path to download script (classicASP and ASP.NET versions included)
			addRollover: true,//add rollover fade to each multibox link
	//		addOverlayIcon: true,//adds overlay icons to images within multibox links
	//		addChain: true,//cycle through all images fading them out then in
			recalcTop: true,//subtract the height of controls panel from top position
	//		addTips: true//adds MooTools built in 'Tips' class to each element (see: http://mootools.net/docs/Plugins/Tips)
			showControls:false
			});



}

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