var infodivs=Array();
infodivs[0]="wholescreen";
infodivs[1]="infodiv";
infodivs[2]="infocontent";

function showInfoDiv(id)
{

	//gid='infocontent';
	var param=addParam('id',id)+"&"+addParam('mode','infodiv');
	//alert(param);
	requestFromServ('ajax.xml.php',param,'handleReceivingInfodiv');
	showIDiv();
}

function showIDiv()
{
	var nm=_gid("infodiv");
	nm.style.top='50px';
	nm.style.left='200px';
	nm.style.top=nm_top;
	nm.style.left=nm_left;
	for (ii=0;ii<infodivs.length ;ii++ )
	{
		odiv=_gid(infodivs[ii]);
		//alert(odiv.id);
		if (odiv!=undefined)
		odiv.style.visibility="visible";
	}
}//function showMD()
//--------------------------------------------------------
function hideInfoDiv()
{
	var nm=_gid("infodiv");
	nm.style.top='50px';
	nm.style.left='2000px';
	for (ii=0;ii<infodivs.length ;ii++ )
	{
		odiv=_gid(infodivs[ii]);
		if (odiv!=undefined)
		odiv.style.visibility="hidden";
	}
}//function hideMesgDiv()



/* function that handles the http response when updating messages */
function handleReceivingInfodiv() 
{
	if (xmlHttpGetData.readyState == 4) // continue if the process is completed
	{
		if (xmlHttpGetData.status == 200) // continue only if HTTP status is "OK"
		{
			try // process the server's response
			//----------------------------------
			{ readInfodiv(); }
			//----------------------------------
			catch(e) // display the error message
			{ displayError(e.toString()); }
		}
		else // display the error message
		{ displayError(xmlHttpGetData.statusText); }
	}
}//function handleReceivingInfodiv() 

//-----------------------------------------------


/* function that processes the server's response when updating messages */
function readInfodiv()
{  
	// retrieve the server's response 
	var response = xmlHttpGetData.responseText;
	// server error?
	if (response.indexOf("ERRNO") >= 0 
		|| response.indexOf("error:") >= 0
		|| response.length == 0)
		throw(response.length == 0 ? "Void server response." : response);
	// retrieve the document element
	response = xmlHttpGetData.responseXML.documentElement;
	//getdata
	descrArr = response.getElementsByTagName("infodiv");
	//display data
	displayInfodiv(descrArr);
} //function readStory()

//-----------------------------------------------------------------------------

function  displayInfodiv(descrArr)
{
	var odd=true;
	var htmlMessage = "";
	for(var i=0; i<descrArr.length; i++)
	{
		// get the message details
		var descr = trim(descrArr.item(i).firstChild.data.toString());
		htmlMessage += descr;
		odd=!odd;
	}
	_gid('infocontent').innerHTML=htmlMessage;
}//function  displayStory(pidArr, didArr, pictureArr, summaArr)

