window.addEvent('domready', function() {
	Element.implement({
		//implement show
		show: function() {
			this.setStyle('display','');
		},
		//implement hide
		hide: function() {
			this.setStyle('display','none');
		}
	});
	
	if($('footer'))
	{
		if(document.body.offsetHeight > ($('wrap').offsetHeight + 138))
		{
			$('footer').style.position = 'absolute';
			$('footer').style.bottom = '0';
		}
	}
	
	
	if($$('.detail').length > 0)
	{
		$$('.detail').each(function(element){
			$(element.id).hide();
		});
	}
	
	
	if($$('.hoverMe').length > 0)
	{
		$$('.hoverMe').each(function(element){
			element.addEvent('mouseover', function(e){
				new Event(e).stop();
				
				$$('.detail').each(function(element2){
					if(element2.id == "the_"+element.id)
					{
						$(element2.id).show();
					}
					else
					{
						$(element2.id).hide();
					}
				});
				
				$$('.galElement').each(function(element2){
					if(element2.id == "thes_"+element.id)
					{
						$(element2.id).style.zIndex = '1000';
					}
					else
					{
						$(element2.id).style.zIndex = '10';
					}
				});
			});
			
			element.addEvent('mouseout', function(e){
				new Event(e).stop();
				
				$$('.detail').each(function(element2){
					$(element2.id).hide();
				});
				
				$$('.galElement').each(function(element2){
					$(element2.id).style.zIndex = '10';
				});
			});
		});
	}
});
