//code author: Reyco Evangelista


var xmlHttp;
var idContent;






function getBody(idIn, urlIn){
	idContent=idIn;
	var url=urlIn;

	document.getElementById('ifidBodyText').style.opacity="0.15";
	document.getElementById('ifidBodyText').style.filter="alpha(opacity=15)";


	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request");
		return;
	}
	//url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged; 
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function stateChanged() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		var temp=xmlHttp.responseText.indexOf('<body');
		var start=xmlHttp.responseText.indexOf('>', temp + 3 ) + 1;
		var stop =xmlHttp.responseText.indexOf('</body>');
		//"<div style='float: left; display: inline; width: 100%; height:200px'></div>"+
		document.getElementById(idContent).innerHTML=xmlHttp.responseText.substring(start, stop).replace(/class=\"bodytext\"/g,"class='bodytext' id='ifidBodyText'");

		document.getElementById('ifidBodyText').style.opacity="";
		document.getElementById('ifidBodyText').style.filter="";

	} 
}

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