var Contact = new Class({
	collection	: null,
  entrys			: null,
	current			: 0,
	
	initialize	: function(background) {
		var $this = this;
		
		$$('div.col-contact').each(function(entry) {
			$inner = entry.getChildren('div.contact-inner')[0];
			$back	 = entry.getChildren('div.contact-background')[0];
			
			$back.setStyles({
				'opacity'		: 0,
				'cursor'		: 'pointer'
			});
			
			$inner.setStyles({
				'opacity'		: 0,
				'cursor'		: 'pointer'
			});
			
			entry.setStyle('cursor','pointer');
			entry.inner	= $inner;
			entry.back	= $back;
			
			entry.addEvents({
				'mouseover' : function() {
					$this.reset();
					
					this.back.fade('in');
					this.inner.fade('in');
				}.bind(entry),
				
				'mouseout'	: function() {
					this.back.fade('out');
					this.inner.fade('out');
				}.bind(entry)
			});
		});
	},
	
	highlight: function(e) {
		var $this		= this;
		var $entrys = $$('div.col-contact.'+e);
		var $first	= true;
		
		if($entrys.length > 0) {
			$this.reset();
			
			$entrys.each(function(item) {
				if($first == true) {
					$first = item;
				}
				
				item.back.fade('in');
				item.inner.fade('in');
			});
			
			var $pos = $first.getPosition();
			window.scrollTo($pos.x,($pos.y-50));
		}
	},
	
	reset: function() {
		$$('div.col-contact').each(function(entry) {
			entry.back.fade('out');
			entry.inner.fade('out');
		});
	}
});

