// JavaScript Document

	
	function doLightBox(id, custom) {
		if(!custom) {
			request = new HttpRequest();
			request.addHeader("Content-Type", "text/html");
			request.onComplete = function(response) {
		//		alert(response.status);
		//		alert(response.text);
				$tag("body").item(0).innerHTML += response.text;
	
			}
			
			request.get("/dialogue/" + id + ".html");		
		}
		
		document.getElementById('overlay').className = "overlay";
	//	document.getElementById(id).style.display= "block";		
		if (typeof document.height != 'undefined') {
			docHeight = document.height;
		}
		else if (document.body && typeof document.body.scrollHeight !=
			'undefined') {
			docHeight = document.body.scrollHeight;
		}

	document.getElementById("overlay").style.height = docHeight + 20 + "px";
		

		
	}
	
	function doImage(type) {
		//alert("TEST");
		request = new HttpRequest();
		request.addHeader("Content-Type", "text/html");
		request.onComplete = function(response) {
			 var newdiv = document.createElement('div');
			 
			 newdiv.innerHTML = response.text;
			 $tag("body").item(0).appendChild(newdiv);
			//$id("imagesPhoto").innerHTML = response.text;
				//$tag("body").item(0).innerHTML += response.text;
		}
		request.get("/dialogue/image.php?type=" + type);		
		
		document.getElementById('overlay').className = "overlay";
		//document.getElementById(id).style.display= "block";		
		if (typeof document.height != 'undefined') {
			docHeight = document.height;
		}
		else if (document.body && typeof document.body.scrollHeight !=
			'undefined') {
			docHeight = document.body.scrollHeight;
		}

	document.getElementById("overlay").style.height = docHeight + 20 + "px";
		

		
	}
	
	
	
	
	
	
	
	function cancelLightBox(id) {
		document.getElementById(id).parentNode.removeChild(document.getElementById(id));	
		document.getElementById('overlay').className = "";
		document.getElementById("overlay").style.height = 1 + "px";		
	}
	