var xmlHttp
var loadstatustext="<FONT style=BACKGROUND-COLOR: #990033 color=#ff0033><STRONG><FONT color=#123B69>&nbsp;Loading....</FONT></STRONG></FONT>";
var divFaq
var dv
function showFAQAnswer(str,cid,show,totNum)
{
	divFaq = 'divFaq' + str
	
	for(i=1; i<=totNum; i++) {
		dv = 'divFaq' + i
		document.getElementById(dv).setAttribute("class", "linkFaqQuestion")
	}
	
	if (str.length==0 && id.length==0)
	{ 
		return
	}
	xmlHttp=GetXmlHttpObject2()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="php/showFAQAnswer.php"
	id		=str
	cid		=cid
	show	=show
	totNums	=totNum
	show	=document.getElementById("SHOW").value;
	ecid	=document.getElementById("cid").value;
	if(show=='0' && cid==ecid)
	{
		show=1;
		document.getElementById("SHOW").value=1;
		document.getElementById("cid").value=cid;
	}
	else
	{
		show=0;
		document.getElementById("SHOW").value=0;
		document.getElementById("cid").value=cid;
	}
	url=url+"?id="+id+"&cid="+cid+"&show="+show+"&totNums="+totNums
	url=url+"&stid="+Math.random()
	xmlHttp.onreadystatechange=stateChanged2 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
} 

function stateChanged2() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{	
		for(i=1;i<=totNums;i++)
		{
			var txtContent="txtContent"+i
			document.getElementById(txtContent).innerHTML="";
		}
		var txtContent="txtContent"+id
		document.getElementById(txtContent).innerHTML=xmlHttp.responseText
		if(document.getElementById("SHOW").value==0) {
			document.getElementById(divFaq).setAttribute("class", "linkFaqQuestionRed")
		}
	} 
} 

function GetXmlHttpObject2()
{ 
	var objXMLHttp=null
	if (window.XMLHttpRequest)
	{
		objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
} 
