// JavaScript Document
$(document).ready(function(){

	var textwrapper = document.getElementById("textwrapper");
	$("div#textwrapper").addClass("position_wrapper");
	$("div#mytext").addClass("position_text");
	
	
	
	$("a#textlink").click(function() {
		
		if(textwrapper.style.display == "none") {
			
			$("img#slide").fadeOut("slow");
			$("#textwrapper").fadeIn("normal");
			$("div#mycaption").attr("style","visibility:hidden");
			display="block";
			return false;
		} else {
			$("img#slide").fadeIn("normal");
			$("#textwrapper").fadeOut("normal");
			$("div#mycaption").attr("style","visibility:visible");
			display="none";
			
			return false;
		}						   
	
		
						   }); 
	
	
/*	$("a#bio").click(function() {
							  DBqueryText();
							  $("div#controls,div#leftarrow,div#rightarrow").attr("style","visibility:hidden");
							  return false;
							  });
							  */
	});
	
function DBqueryText() { // Sends a query to the database.

// Check if browser supports HTTP Requests object.	
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }

var url="xmlRequestText.php";


xmlHttp.onreadystatechange=function() {
		
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 

  xmlDoc=xmlHttp.responseXML;

var biography = xmlDoc.getElementsByTagName("bio")[0].childNodes[0].nodeValue;
var education = xmlDoc.getElementsByTagName("ed")[0].childNodes[0].nodeValue;
var publications = xmlDoc.getElementsByTagName("pub")[0].childNodes[0].nodeValue;
var exhibitions = xmlDoc.getElementsByTagName("ex")[0].childNodes[0].nodeValue;

var biotext = '<div id="biotext"><h4 id="bio">Biography</h4><p>' + biography;
biotext += '</p><h4 id="education">Education</h4><p>' + education;
biotext += '</p><h4 id="publications">Publications</h4><p>' + publications;
biotext += '</p><h4 id="exhibitions">Exhibitions</h4><p>' + exhibitions;

document.getElementById("content").innerHTML = biotext;

 }
		
	
	}

	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);

}

