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


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

DakotaSettings.REVIEW_SNIPPET_DOCUMENT = new BelowProductPhotoDocument('dakota_review_snippet');

var BelowDescriptionAboveRelatedDocument = Class.create(FixedLocationDocument, {
	RELATED_PRODUCTS_SELECTOR: '.colors_lines_light',
	FORM_NAME: 'MainForm',
	
	addElementToFixedLocation: function(element) {
		var containers = null;
		var container = null;
		var before = true;
		
		//Try and get related products, if not, get the form
		containers = $$(this.RELATED_PRODUCTS_SELECTOR);
		if(containers.size() < 1) {
			before = false;
			containers = new Array(document.getElementsByName(this.FORM_NAME));
		}
		if(containers.size() < 1) {
			return;
		}
		
		//Get the element object
		container = $(containers.first());
		if(container == null) {
			return;
		}
		
		//Add the element
		var insertHash = before ? {before: element} : {after: element}
		container.insert(insertHash);
	}
});
DakotaSettings.REVIEW_DOCUMENT = new BelowDescriptionAboveRelatedDocument('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;
DakotaSettings.PRODUCT_MINIMUM_REVIEWS_TO_DISPLAY = 0;
/*--------------------------------------------------------------------------*/


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