// JavaScript Document
function showDivs(){
	var mask;
	var photo;
	mask = document.getElementById('mask');
	mask.style.visibility = 'visible';
	mask.style.height='100%';
	mask.style.width='100%';
	photo = document.getElementById('photo');
	photo.style.visibility = 'visible';
}

function showImage(id, type, directory){
	var request;
	if(request=xml_http_request()){
		request.onreadystatechange = function(){
			if(request.readyState==4){
				document.getElementById('photo').innerHTML = request.responseText;	
			}
		}
		request.open("GET", "photo.php?id="+id+"&directory="+directory+"&type="+type, true);
		request.send(null);
	}
}


function hideDivs(){
	document.getElementById('photo').style.visibility='hidden';
	document.getElementById('mask').style.visibility='hidden';
}

function positionDiv(width, height){
	var div;
	div = document.getElementById('photo');
	if(width >= document.body.clientWidth){
		div.style.left = "0px";
	}
	else{
		div.style.left = ((document.body.clientWidth - width - 20)/2) + "px";
	}
	if((height + 80) >= document.body.clientHeight){
		div.style.top = "0px";
	}
	else{
		div.style.top= ((document.body.clientHeight - height -80)/2) + "px";
	}
	document.getElementById('photo_description').style.width = (width*.59)+"px";
	document.getElementById('photo_thanks').style.width = (width*.39)+"px";
}