// JavaScript Document - faq
var mywindow;
var callingID;
var previousID;
function getFAQData(id)
{	
	if(previousID) {	// first time in there is no valid value
		removeFAQData(previousID);
	}
	//confirm(id)
	callingID = id;
	//mywindow = window.open("","_blank", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=800");
	var post_pairs = 'sid='+Math.random()+'&id='+id
	var getFAQData = new Ajax.Request("getFAQData.php", 
		{method: 'post', parameters: post_pairs, asynchronous: false, onComplete: responseFAQData});
}

function responseFAQData(getFAQData) {
	if (mywindow) mywindow.document.write(getFAQData.responseText);
	$('FAQ'+callingID).innerHTML = getFAQData.responseText;
	previousID = callingID;
}

function removeFAQData(id)
{	
	callingID = id;
	$('FAQ'+callingID).innerHTML = '';
}