/*--------------------------------------------------------------------------*
 * 
 * Volusion(C) PowerReviews(C) Integration (Dakota)
 * 
 * Version 1.0.6
 * 
 * Copyright (C) 2009 Brand Labs LLC
 * 
 *--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*
 * PowerReviews Configuration
 *--------------------------------------------------------------------------*/
DakotaSettings.MERCHANT_ID = 11141;
DakotaSettings.OVERRIDE_STYLE_SHEET_HTML = '<link type="text/css" rel="stylesheet" href="http://www.ycasolarlightstore.com/v/dakota/css/powerreviews_express.css"/>';
/*--------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------*
 * Output directly below the product price/details box
 *--------------------------------------------------------------------------*/
var BelowProductPriceDocument = Class.create(FixedLocationDocument, {
	FORM_NAME: 'MainForm',
	PRICE_BOX_CLASS: 'colors_pricebox',
	
	addElementToFixedLocation: function(element) {
		var containers = document.getElementsByName(this.FORM_NAME);
		var container = null;
		var elements = null;		
		
		//Make sure the form is available
		if(containers.length <= 0) {
			return;
		}
		
		//Get the element object
		container = $(containers[0]);		
		if(container == null) {
			return;
		}
		
		//Locate the price box
		elements = container.select('.'+this.PRICE_BOX_CLASS);
		if(elements == null || elements.size() <= 0) {
			//No price box, don't do anything.
			return;
		}
		container = elements.last();//we want this after the last pricebox on the page.
		
		//Add the element, after the container
		container.insert({after: element});
	}
});

/*--------------------------------------------------------------------------*
 * PowerReviews Configuration
 *--------------------------------------------------------------------------*/
DakotaSettings.ENABLED = true;

DakotaSettings.REVIEW_SNIPPET_DOCUMENT = new BelowProductPriceDocument('dakota_review_snippet');
DakotaSettings.REVIEW_DOCUMENT = new BelowProductDescriptionDocument('dakota_review');
DakotaSettings.CATEGORY_REVIEW_SNIPPET_DOCUMENT = BelowAnonymousLocationDocument;
DakotaSettings.CATEGORY_REVIEW_SNIPPET_CSS_CLASS = 'dakota_review_snippet_category';
DakotaSettings.CATEGORY_MINIMUM_REVIEWS_TO_DISPLAY = 1;
/*--------------------------------------------------------------------------*/


/*--------------------------------------------------------------------------*
 * Start up the module
 *--------------------------------------------------------------------------*/
try {
	Dakota.load();
}
catch(e) {/*No-op*/}
/*--------------------------------------------------------------------------*/