window.addEvent('domready', function () {
	<!-- ADD TO BASKET -->
	var _toBasket = function() {
		$$('.to-basket').removeEvent('click');
		$$('.to-basket').addEvent('click', function(e){AddToBAsketCostum(e,this)});
	}
	
	<!-- BANNERS Slideshow -->
	$$('#big-banner-pages a').addEvent('click', function(e){
		e.stop();
		$$('#big-banner-pages a').each(function(elm){
			elm.removeClass('active')
		});
		this.addClass('active');
		
		var box = 'ad-slide-' + this.get('rel');

		$$('.slide').each(function(el){
			if(el.get('id') == box) {
				el.set('tween', { duration: 700 }).fade('in');
				el.removeClass('none');
			} else {
				el.set('tween', { duration: 700 }).fade('out');
				el.addClass('none');
			}
		});
	});
	
	var _banerShow = function() {
		try{
		
		var cur=0;
		var next;
		var cur_num;
		var cur_totalQty = $$('#big-banner-pages a').length;
		$$('#big-banner-pages a').each(function(elm){
			cl = elm.get('class');
			if(cl == 'active') {
				cur = elm;
				elm.removeClass('active');
			}
		});
			if(cur)
			{
				cur_num = cur.get('rel').toInt();
				
				
				if(cur_num == cur_totalQty) {
					next = 1;
				} else {
					next = cur_num + 1;
				}
				
				$$('#big-banner-pages a').each(function(elm){
					cl = elm.get('rel');
					if(cl == next) {
						elm.addClass('active');
					}
				});
				
				var box = 'ad-slide-' + next;
		
				$$('.slide').each(function(el){
					if(el.get('id') == box) {
						el.set('tween', { duration: 700 }).fade('in');
						el.removeClass('none');
					} else {
						el.set('tween', { duration: 700 }).fade('out');
						el.addClass('none');
					}
				});
				setTimeout(_banerShow, 5*1000); // 5 seconds
			}
		}catch(e){alert(e)}
	}
	
	<!-- Product List Choosing -->
	var _initProductList = function() {
		$$('#product-list-items a').addEvent('click', function(e){
			e.stop();
			$$('#product-list-items a').each(function(elm){
				elm.removeClass('active')
			});
			this.addClass('active');
			
			var number = this.get('rel');
	
			$$('.product-list-open-item').each(function(el){
				if(el.get('rel') == number) {
					el.removeClass('none');
				} else {
					el.addClass('none');
				}
			});
		});
	}
	
	<!-- PRODUCT List Paging -->
	var _initPaging = function() {
		$$('#paging a').addEvent('click', function(e){
			e.stop();
			$('product-list').addClass('relative');
			
			new Element('div', {
				'class': 'ajax-loader',
				'styles': {
					'width': $('product-list').getStyle('width'),
					'height': $('product-list').getStyle('height'),
					'opacity': '0.75',
					'z-index': '50',
					'position': 'absolute',
					'top': '0'
				}
			}).inject($('product-list'));
			
			new Request({ url: this.get('href'), method: 'get',
				 onSuccess: function (data) {
				 	$('product-list').set('html', data);
				 	_initPaging();
				 	_initProductList();
				 	_toBasket();
				 }
			 }).send();
		});
	}
	
	<!-- CHOOSEN PRODUCT List Choosing -->
	var _initChoosenList = function() {
		$$('#product-listing a').addEvent('click', function(e){
			e.stop();
			$$('#product-listing a').each(function(elm){
				elm.removeClass('active')
			});
			this.addClass('active');
			
			var number = this.get('rel');
	
			$$('.product-open-item').each(function(el){
				if(el.get('rel') == number) {
					el.removeClass('none');
				} else {
					el.addClass('none');
				}
			});
		});
	}

	setTimeout(_banerShow, 10000);
	_toBasket();
	_initPaging();
	_initProductList();
	_initChoosenList();	
});