/*--------------------------------------------------------------------------*
 * 
 * Volusion(C) PowerReviews(C) Integration (Dakota)
 * 
 * Version 1.0.3
 * 
 * Copyright (C) 2009 Brand Labs LLC
 * 
 *--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*
 * PowerReviews Configuration
 *--------------------------------------------------------------------------*/
DakotaSettings.MERCHANT_ID = 11084;
/*--------------------------------------------------------------------------*/


/*--------------------------------------------------------------------------*
 * PowerReviews Configuration
 *--------------------------------------------------------------------------*/
DakotaSettings.ENABLED = true;

DakotaSettings.OVERRIDE_STYLE_SHEET_HTML = '<link type="text/css" rel="stylesheet" href="http://www.theshelvingstore.com/v/dakota/css/powerreviews_express.css"/>';
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;
/*--------------------------------------------------------------------------*/


/*--------------------------------------------------------------------------*
 * Custom Product Detail Configuration
 *--------------------------------------------------------------------------*/
var BelowProductPhotoAndButtonDocument = Class.create(FixedLocationDocument, {
	IMAGE_ELEMENT_ID: 'product_photo',
	ANCHOR_ELEMENT_ID: 'product_photo_zoom_url',
	
	addElementToFixedLocation: function(element) {
		var container = $(this.ANCHOR_ELEMENT_ID);
		
		//Make sure something is available
		if(container == null) {
			container = $(this.IMAGE_ELEMENT_ID);
		}
		//If still do not have a container, exit
		if(container == null) {
			return;	
		}		
		
		//Go to parent
		container = container.up();
		//Nothing exit
		if(container == null) {
			return;
		}

		//Add element after container
		container.insert(element);
	}
});

var BelowProductPhotosDocument = Class.create(FixedLocationDocument, {
	ANCHOR_ELEMENT_ID: 'product_photo_zoom_url',
	ALT_PHOTOS_ELEMENT_ID: 'altviews',
	
	addElementToFixedLocation: function(element) {
		var container = $(this.ALT_PHOTOS_ELEMENT_ID);
		
		//Make sure something is available
		if(container == null) {
			container = $(this.ANCHOR_ELEMENT_ID);
		}
		//If still do not have a container, exit
		if(container == null) {
			return;	
		}		
		
		

		//Add element after container
		container.insert({after:element});
	}
});
DakotaSettings.REVIEW_SNIPPET_DOCUMENT = new BelowProductPhotosDocument('dakota_review_snippet');
/*--------------------------------------------------------------------------*/


/*--------------------------------------------------------------------------*
 * Start up the module
 *--------------------------------------------------------------------------*/
Dakota.load();
/*--------------------------------------------------------------------------*/
