window.onload=init;

function init(){
	o0=document;
	for(var i=0;i<o0.getElementsByTagName("td").length;i++){
		o1=o0.getElementsByTagName("td")[i];
		if(o1.className=="picture")
			pictureBlock(o1);
	}
}


function pictureBlock(o0){
	details=false;
	for(var i=0;i<o0.getElementsByTagName("div").length;i++){
		o1=o0.getElementsByTagName("div")[i];
		if(o1.className=="details"){
			details=true;
			break;
		}
	}
	oPic=o0.getElementsByTagName("img")[0];
	if(details){
		o1.style.visibility="hidden";
		oPic.onmouseover=function(){toggleDetails(this.parentNode.parentNode,true)};
		oPic.onmouseout=function(){toggleDetails(this.parentNode.parentNode,false)};
		
	}
	oPic.onclick=popup;
}



function popup(e){
	if(!e) var e=window.event;
	if(e.target)srcE=e.target;
	else if(e.srcElement)srcE=e.srcElement;
	w=900; h=700;
	src="picture.php?src="+srcE.parentNode.href;
	window.open(src, "picDisplay", 'width='+w+',height='+h+', scrollbars=no');
	return false;
}

function toggleDetails(o0,b){
	details=false;
	for(var i=0;i<o0.getElementsByTagName("div").length;i++){
		o1=o0.getElementsByTagName("div")[i];
		if(o1.className=="details"){
			details=true;
			break;
		}
	}
	if(details) o1.style.visibility=(b? "visible":"hidden");
}







