Event.observe(window,"load",function(){
	$$('.popUpImage').invoke("observe","mouseover",showPopUp).invoke("observe","mouseout",closePopUp);
});
function showPopUp(event){
	var element=Event.element(event);
	var id=element.getAttribute("rel");
	if(!id){
		return;
	}
	var xScroll, yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
		xScroll = self.pageXOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
		xScroll = document.documentElement.scrollLeft;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
		xScroll = document.body.scrollLeft;	
	}
	
	var windowWidth, windowHeight;
	
	if (self.innerHeight) {	// all except Explorer
		if(document.documentElement.clientWidth){
			windowWidth = document.documentElement.clientWidth; 
		} else {
			windowWidth = self.innerWidth;
		}
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	var src="/images.php?id="+id;
	var image=document.createElement("IMG");
		image.style.position="absolute";
		//image.style.left=parseInt(event.clientX+50*1)+"px";
		image.style.left=parseInt((windowWidth-640)/2)+"px";
		image.style.top=parseInt(yScroll+50*1)+"px";
		image.src=src;
		image.style.border="3px";
		image.style.borderStyle="solid";
		image.style.borderColor="#ffffff";
		image.style.zIndex=100;
		image.id="popUpImg";
		Event.observe(image,"mouseout",closePopUp);
	$("bo").appendChild(image);
}
function closePopUp(event){
	if($("popUpImg")){
		if(event.relatedTarget)if(event.relatedTarget.id=="popUpImg")return;
		$("bo").removeChild($("popUpImg"));
	}
}
