
$_DUCEDIS.extend({
	initFoot: function(){
		/*this.showItemChild();
		try{
			var topmenu = $ES('.topmenu a');
			var first = topmenu[0];

			if ( $_CONFIG['favlink'] ) {
				var menus = topmenu ? topmenu.length : 0;
				var target = $E('.topmenu .TreeList') ? $E('.topmenu .TreeList') : $E('.topmenu');
				var i = $_CONFIG['favlink']['index'];
				i = i < 0 ? menus + i + 1 : i;

				var el = new Element('div', {
					'class': $_find('cat', topmenu[0].parentNode.className) ? 'cat1' : ''
				}).adopt( new Element('a', {
					'styles': { cursor: 'pointer'},
					'class': i ? '' : 'nobg',
					'href': 'javascript:;',
					'events': {
						'click' : function(){
							if ( document.all )
								window.external.addFavorite($_CONFIG['favlink']['host'], $_CONFIG['favlink']['title']);
							else if ( window.sidebar )
								window.sidebar.addPanel($_CONFIG['favlink']['title'], $_CONFIG['favlink']['host'], "");
						}
					}
				}).set('text', $_CONFIG['favlink']['text']) );

				first = i ? topmenu[0] : null;

				if ( i >= menus || i < 0 ){
					target.appendChild(el);
				} else {
					var before = $_find('cat', topmenu[i].parentNode.className) ? topmenu[i].parentNode : topmenu[i];
					target.insertBefore(el, before);
				}
			}

			if(first) 
				first.style.background = 'none';
		}
		catch(e){}*/

		var gotop=new Element('a', {
			'class': 'gotop',
			'styles': {
				cursor: 'pointer', 
				position:'fixed',
				zIndex:10,
				'bottom':'10%',
				display: 'none'
			},
			'events': {	
				'click' : function(){ 
					document.body.scrollTo(0); 
					this.setStyle('display', 'none');
					return false;
				} 
			}
		});

		var backTopLeft=function(){
			var btLeft = window.getWidth()/2+480;
			if(window.ie6) gotop.setStyle('position', 'absolute');
			if(btLeft <= 960){
				gotop.setStyle('left', 960);
			}else{
				gotop.setStyle('left', btLeft);
			}
		};

		window.addEvents({
			'domready': function(){
				gotop.inject(document.body);
				backTopLeft();
			},
			'scroll': function(){
				if(window.getScrollTop()===0){
					gotop.setStyle('display', 'none');
				}else{
					gotop.setStyle('display', 'block');
					if(window.ie6)
						gotop.setStyle('top', window.getScrollTop()+window.getHeight()-150);
				}
			},
			'resize':function(){
				backTopLeft();
			}
		});

		window.addEvent('domready',function(){
			/*if($_SCREEN_W){
				$ES('.widget_preview').each(function(widget){
					var autowidth = widget.get('autowidth').toInt();
					if(autowidth>0){
						widget.setStyle('width',autowidth);
					}
				});
			}*/
			var intro;
			if(intro=$('goods-intro')){
				intro.getElements('img').each(function(p){
					var u=p.get("init_src")||p.get("src");
					if(!u){return}
					new Asset.image(u, {
						onload:function(){
							if(!this||!this.width){
								return;
							}
							var f=$_DUCEDIS.getTrueSize(intro);
							var s = {'width':this.width,'height':this.height};
							if(this.width>f.x){
								s['width']=f.x;
								s['height']=f.x*this.height/this.width;
							}
							p.setStyles(s);
						}
					});
				})
			}
		});
	}
});

$_DUCEDIS.initFoot();

