// JavaScript Document
function initSpecialsGallery(e){
	var b=e.getElementsByTagName('img'),
		ul=e.getElementsByTagName('ul')[0],
		li=ul.getElementsByTagName('li'),
		c=e.getElementsByTagName('div')[0];
	ul.style.width=(li.length*(li[0].offsetWidth+2))+'px';
	todo.loop(li,function(){
		var e=this.parentNode.parentNode;
		if(e.offsetHeight<this.offsetHeight)
			e.style.height=this.offsetHeight+'px';
	});
	c._left=b[0];
	c._right=b[1];
	c._spead=8;
	c._stop=function(){window.clearInterval(this._timer);};
	c._startRight=function(){
		window.clearInterval(this._timer);
		this._timer=window.setInterval(function(e){return function(){
			if(e.scrollLeft <= e.scrollWidth - e.style.width)e.scrollLeft += e._spead;
			else e._stop();
		}}(this),50);
	};
	c._startLeft=function(){
		window.clearInterval(this._timer);
		this._timer=window.setInterval(function(e){return function(){
			if(e.scrollLeft >= 0) e.scrollLeft -= e._spead;
			else e._stop();
		}}(this),50);
	};
	c._left._o=c._right._o=c;
	c._left.onmouseover=function(){this._o._startLeft();};
	c._right.onmouseover=function(){this._o._startRight();};
	c._left.onmouseout=c._right.onmouseout=function(){this._o._stop();};
	
		var l={
		'contacts_address'			:'address/',
		'home_contacts_link'		:'address/',
		'write_letter'				:'feedback/',
	};
	for(id in l){
		var e=todo.get(id);
		if(e)e.onclick=function(url){return function(){window.location=url;}}(l[id]);
	};
};
