	function hideImage(){
		if($('imageDisp')){
			Effect.Fade($('imageDisp'),{duration:1,queue:'end'});
			Effect.Fade($('theImage'),{duration:1,queue:'front'});
		}
	}
	
	function showImage(o){
		
		if($('imageDisp')){
			Effect.Fade($('imageDisp'));
			$('imageDisp').remove();
		}
		
		if($('toolTip')){
			document.body.removeChild($('toolTip'));
		}
		
		newImg = Builder.node("img",{src: o, id: 'theImage'});
		
		imgShow = Builder.node("div", {className: "overlay", id: "imageDisp" },newImg);
		
		imgShow.onclick = function(){
			hideImage();
		}

		new PeriodicalExecuter(function(pe) {
		  w = $('theImage').width;
		  h = $('theImage').height;
		   	
		  if(w>0&&h>0&&(parseInt(w)+parseInt(h))>58){
		  	delayImg(imgShow,$('theImage'));
		  	pe.stop();
		  }
		}, 1);
		
		document.body.insertBefore(imgShow, document.body.childNodes[0]);
		imgShow.style.height = document.body.offsetHeight + 'px';
		imgShow.style.left = '-10000px';
		newImg.style.left = '-10000px';
		
		//setTimeout('delayImg(imgShow,newImg)',800);
	}
	
	function delayImg(divo,io){
		ih = io.height;
		iw = io.width;
		
		_passDivo = divo;
		
		divo.style.left = 0;
		divo.style.width = 'auto';
		
		divo.style.overflow = 'visible';
		divo.style.display = 'none';
		io.style.display = 'none';
		
		vh = document.viewport.getHeight();
		vw = document.viewport.getWidth();
		
		tTop = (document.viewport.getScrollOffsets().top)+((vh/2)-(ih/2));
		io.style.top = ((tTop<0)?20:tTop) +'px';
		
		io.style.left = (vw/2)-(iw/2)+'px';
		
		if($('toolTip')){
			document.body.removeChild($('toolTip'));
		}			

		Effect.Appear(divo,{duration:1,queue:'front'});
		Effect.Appear(io,{duration:1,queue:'end'});
		divo.style.height = getPageSizeWithScroll()[1] + 'px';
		oi = setTimeout("setElFullScreen()",1000);
	}
	
	function setElFullScreen(o){
		//alert(_passDivo)
		_passDivo.style.height = getPageSizeWithScroll()[1] + 'px';
	}
	
	function getPageSizeWithScroll(){
		if (window.innerHeight && window.scrollMaxY) {// Firefox
			yWithScroll = window.innerHeight + window.scrollMaxY;
			xWithScroll = window.innerWidth + window.scrollMaxX;
		} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
			yWithScroll = document.body.scrollHeight;
			xWithScroll = document.body.scrollWidth;
		} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
			yWithScroll = document.body.offsetHeight;
			xWithScroll = document.body.offsetWidth;
	  	}
		arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);
		//alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );
		return arrayPageSizeWithScroll;
	}

	
