AMCSiteClass.implement({

	// *************************************************************************
	// Products Init
	// *************************************************************************
	ProductsInit : function() {
	
		this.QuantityInit();	
		this.ProductImagesSwapInit();	
		
		if (($('ExtraContentButton'))&&($('ExtraContent'))) {
				
				
			$('ExtraContentButton').addEvent('click', function() {
				
				$('ExtraContent').setStyles({
					'opacity' : 0,
					'display' : 'block'
				});
				
				var fx = new Fx.Styles($('ExtraContent'), {duration:this.GlobalFadeDuration, wait:false });
				fx.start({ 'opacity' : 1 });	
				var fx2 = new Fx.Styles($('ExtraContentButton'), {duration:this.GlobalFadeDuration, wait:false, onComplete : function() {
					
				
				} });
				fx2.start({ 'opacity' : 0, 'margin-top' : 0 });	
			
			}.bind(this));
			
		}
	
	},

	// *************************************************************************
	// Products Image Swap
	// *************************************************************************
	ProductImagesSwapInit : function() {
	
		var ProductImageLarge = $('ProductImageLarge');
		var ProductImages = $$('#ProductImage li');	
	
		ProductImages.each(function(ProductImage) {
		
			ProductImage.addEvent('click', function() {
			
				var ProductLargeImage = ProductImage.getElement('img');
				ProductLargeImage = ProductLargeImage.src;
				var arrProductLargeImage = ProductLargeImage.split('/');
				ProductLargeImage = arrProductLargeImage[arrProductLargeImage.length-1];
			
				ProductImageLarge.setProperty('src', '/img/products/medium/' + ProductLargeImage);			
				
			}.bind(this));
		
		
		}.bind(this));
	
	},
		
	// *************************************************************************
	// Quantity Init
	// *************************************************************************
	QuantityInit : function() {	
	
		var QuantityCountrols = $$('.QuantityControl');
		
		if (QuantityCountrols) {
		
			QuantityCountrols.each(function(QuantityCountrol) {
		
				var Quantity = QuantityCountrol.getElement('input[name=Q1]');
				var QuantityUp = QuantityCountrol.getElement('div[class=QuantityUp]');
				var QuantityDown = QuantityCountrol.getElement('div[class=QuantityDown]');
				
				QuantityUp.addEvent('click', function() {
					if (Quantity.value=='') { Quantity.value = 0; }
					var NewQuantity = Math.round(Quantity.value) + 1;
					if (NewQuantity!=100) {
						Quantity.value = NewQuantity;
					}
				});	
			
				QuantityDown.addEvent('click', function() {
					if (Quantity.value=='') { Quantity.value = 0; }
					var NewQuantity = Math.round(Quantity.value) - 1;
					if (NewQuantity!=-1) {
						Quantity.value = NewQuantity;
					}
				});	
				
			});
		
		}	
	
	}


});