// JavaScript Document

var xmlHttp;
var lsub

function showContent(cfile, luse)
{
lsub = luse
if (lsub)
	{document.getElementById("mycontent").style.visibility = "hidden"
	 document.getElementById("mycontent").style.display = "none"
	 document.getElementById("mainpart").style.visibility = "visible"
	 document.getElementById("mainpart").style.display = ""
	}
	else 
	{document.getElementById("mainpart").style.visibility = "hidden"
 	 document.getElementById("mainpart").style.display = "none"
	 document.getElementById("mycontent").style.visibility = "visible"	
	 document.getElementById("mycontent").style.display = ""
	}
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url=cfile;
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 if (lsub)
	 {document.getElementById("subpart").innerHTML=xmlHttp.responseText}
 else {document.getElementById("mycontent").innerHTML=xmlHttp.responseText}
 } 
}

function showPoem(cfile)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url=cfile;
xmlHttp.onreadystatechange=newState();
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function newState() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 {
	 alert(xmlHttp.responseText) ;
	 document.getElementById("myworks").innerHTML=xmlHttp.responseText
	 }
else {alert("not ready")}
}


function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}