	//var webroot = '/jennaleighny/trunk/';
	//var webroot = '/trunk/';
	var webroot = '/';
	
	var ShopOptionAttributeManager = new Class( {
	
	Implements: [Options],

	// /////////////////////////////////////////////////////////////////////////////////////////////////////////////// options //
		options: {
			
			RequestPage:			 Class.empty,			// REQUIRED: Relative path to the page that all AJAX requests will call to
			ContentWrapper:		'secondary_options',	// REQUIRED: ID of the Option/attribute selects wrapper
			InventoryWrapper:		'inventory_wrapper',	// REQUIRED: ID of the inventory input wrapper
			ProductID:			'ProductID',			// REQUIRED: ID of the hidden input contining the pages' ProductID
			OptionSelect: 			'option_select',		// REQUIRED: ID of the Option select
			AttributeSelect:		'attribute_select',		// REQUIRED: ID of the attribute select
			InventorySelect:		'inventory_select',		// REQUIRED: ID of the inventory select
			PriceWrapper:			'price_wrapper',		// REQUIRED: ID of the price container
			ImageWrapper:			'large_image'			// REQUIRED: ID of the image wrapper element
			
		},
		
		// /////////////////////////////////////////////////////////////////////////////////////////////////////////////// initialize //
		initialize: function( options ) {
			
			this.setOptions( options );
	
			this.RequestPage		=    this.options.RequestPage;
			this.ContentWrapper		=    this.options.ContentWrapper;
			this.InventoryWrapper	=    this.options.InventoryWrapper;
			this.ProductID			= $( this.options.ProductID ).value;
			this.OptionSelect		= $( this.options.OptionSelect );
			this.AttributeSelect	= $( this.options.AttributeSelect );
			this.InventorySelect	=    this.options.InventorySelect;
			this.PriceWrapper		=    this.options.PriceWrapper;
			this.ImageWrapper		=    this.options.ImageWrapper;

			if( this.OptionSelect ) {
				this.OptionSelect.addEvent( 'change', this.RetrieveContentWrapper.bindWithEvent( this ) );
			};
			
			if( this.AttributeSelect ) {
				this.AttributeSelect.addEvent( 'change', this.RetrieveInventoryValues.bindWithEvent( this ) );
			};
			
		},
		
		// /////////////////////////////////////////////////////////////////////////////////////////////////////////////// RetrieveOptionValues //
		RetrieveContentWrapper: function ( event ) {
			
			var HTMLRequest1 = new Request.HTML({
				method:		'get',
				url:			this.RequestPage + '/AJAXRequest/RetrieveContentWrapper/ProductID/' + this.ProductID + '/OptionID/' + this.OptionSelect.value,
				link:		'cancel',
				update:		this.ContentWrapper,
				onRequest:	function() {},
				onComplete:	function() {},
				onFailure:	function() { alert( 'Content Wrapper Retrieval Failed' ); },
				onSuccess:	function() {}
			}).send();
			
			var HTMLRequest2 = new Request.HTML({
				method:		'get',
				url:			this.RequestPage + '/AJAXRequest/RetrievePrice/ProductID/' + this.ProductID + '/OptionID/' + this.OptionSelect.value,
				link:		'cancel',
				update:		this.PriceWrapper,
				onRequest:	function() {},
				onComplete:	function() {},
				onFailure:	function() { alert( 'Price Retrieval Failed' ); },
				onSuccess:	function() {}.bind( this )
			}).send();
			
			var HTMLRequest3 = new Request.HTML({
				method:		'get',
				url:			this.RequestPage + '/AJAXRequest/RetrieveDetailImage/ProductID/' + this.ProductID + '/OptionID/' + this.OptionSelect.value,
				link:		'cancel',
				update:		this.ImageWrapper,
				onRequest:	function() {},
				onComplete:	function() {},
				onFailure:	function() { alert( 'Image Retrieval Failed' ); },
				onSuccess:	function() { this.ReInit(); }.bind( this )
			}).send();
			
		},

		// /////////////////////////////////////////////////////////////////////////////////////////////////////////////// RetrieveOptionAttributes //
		RetrieveInventoryValues: function( event, id ) {
			
			var HTMLRequest = new Request.HTML({
				method:		'get',
				url:			this.RequestPage + '/AJAXRequest/RetrieveInventoryValues/ProductID/' + this.ProductID + '/OptionID/' + this.OptionSelect.value + '/AttributeID/' + this.AttributeSelect.value,
				link:		'cancel',
				update:		this.InventoryWrapper,
				onRequest:	function() {},
				onComplete:	function() {},
				onFailure:	function() { alert( 'Inventory Value Retrieval Failed' ); },
				onSuccess:	function() {}
			}).send();
			
			var HTMLRequest2 = new Request.HTML({
				method:		'get',
				url:			this.RequestPage + '/AJAXRequest/RetrievePrice/ProductID/' + this.ProductID + '/OptionID/' + this.OptionSelect.value + '/AttributeID/' + this.AttributeSelect.value,
				link:		'cancel',
				update:		this.PriceWrapper,
				onRequest:	function() {},
				onComplete:	function() {},
				onFailure:	function() { alert( 'Price Retrieval Failed' ); },
				onSuccess:	function() {}.bind( this )
			}).send();
						
		},
				
		// /////////////////////////////////////////////////////////////////////////////////////////////////////////////// RetrieveOptionAttributes //
		RetrieveImage: function( event, id ) {
			
			var HTMLRequest = new Request.HTML({
				method:		'get',
				url:			this.RequestPage + '/AJAXRequest/RetrieveInventoryValues/ProductID/' + this.ProductID + '/OptionID/' + this.OptionSelect.value + '/AttributeID/' + this.AttributeSelect.value,
				link:		'cancel',
				update:		this.InventoryWrapper,
				onRequest:	function() {},
				onComplete:	function() {},
				onFailure:	function() { alert( 'Inventory Value Retrieval Failed' ); },
				onSuccess:	function() {}
			}).send();
			
		},
				
		// /////////////////////////////////////////////////////////////////////////////////////////////////////////////// RetrieveOptionAttributes //
		ReInit: function(  ) {
			
			this.AttributeSelect = $( this.options.AttributeSelect );
			
			if( this.AttributeSelect ) {
				this.AttributeSelect.addEvent( 'change', this.RetrieveInventoryValues.bindWithEvent( this ) );
			};
			
			if( Mediabox ) {
				Mediabox.scanPage();	
			};
			
		}
				
	} );
	
	
function CartDeleteItem( id ) {

	if( $( 'remove_items' ) ) {
	
		if( $( 'remove_item_' + id ) ) {
	
			$( 'remove_item_' + id ).setAttribute( 'checked', 'checked' );
			$( 'remove_item_' + id ).checked = "checked";
			$( 'remove_items' ).submit();
		
		};
	
	};

}