


	function getQuestion(val){
		if (window.XMLHttpRequest){ // Mozilla, Safari, ... 
			http_request = new XMLHttpRequest();
		}
        else if (window.ActiveXObject){ // IE
			http_request = new ActiveXObject("Microsoft.XMLHTTP");
		}
        url = "http://qualitextrading.com/ajax/faq.ajax.php?item=faq&id="+val;
		//window.open(url);
		//exit;
		try{
			http_request.open('GET',url,true)
		} 
		catch(err){
        	alert(err.toString());
        }
		http_request.onreadystatechange = handleResponsefaq;     	
		try{
			http_request.send(null);		
		}
		catch(err){
        	alert(err.toString());
        }
   }
   function handleResponsefaq()
   	{
    if(http_request.readyState != 4 )
		{
            var innerdivHTML = '<img src="http://qualitextrading.com/theme/images/loading.gif">';
			document.getElementById("answer").innerHTML= innerdivHTML;
            //showDiv("working");
		}
   	if (http_request.readyState == 4)
		{
		var xmlDoc = http_request.responseXML;
				//hideDiv("working");
				if(parseInt(xmlDoc.getElementsByTagName("VALUE")[0].firstChild.data) == 1)
				{
					document.getElementById("answer").value = '';
					if(xmlDoc.getElementsByTagName("ANSWER")[0].hasChildNodes())
					{
						var answer = xmlDoc.getElementsByTagName("ANSWER")[0].firstChild.data;
					}
					if(xmlDoc.getElementsByTagName("IMAGE")[0].hasChildNodes())
					{
						var image = xmlDoc.getElementsByTagName("IMAGE")[0].firstChild.data;
					}
					else
					{
						var image = '';
					}
					
					if(xmlDoc.getElementsByTagName("MOVIE")[0].hasChildNodes())
					{
						var movie = xmlDoc.getElementsByTagName("MOVIE")[0].firstChild.data;
					}
					else
					{
						var movie = '';
					}
					if(xmlDoc.getElementsByTagName("ID")[0].hasChildNodes())
					{
						var id = xmlDoc.getElementsByTagName("ID")[0].firstChild.data;
					}

						var tdHtml = '<table width="100%" border="0" cellspacing="0" cellpadding="2">';
					  	if(answer!='')
						{
							tdHtml += '<tr><td colspan="2">&nbsp;</td></tr>';
							tdHtml += '<tr><td colspan="2">'+answer+'</td></tr>';
							tdHtml += '<tr><td colspan="2">&nbsp;</td></tr>';
						}
						tdHtml += '<tr>';
						if(image != '')
						{
							tdHtml += '<td><a href="http://qualitextrading.com/uploaded_files/faq_images/'+image+'" target="_blank"><img src="http://qualitextrading.com/theme/images/imagetag.jpg" alt="Loading" name="img" width="211" height="147" border="0" align="top" id="img"/></a></td>';
						}	
						if(movie != '')
						{
							tdHtml += '<td><a href="http://qualitextrading.com/subpages/mov.php?id='+id+'" target="_blank"><img src="http://qualitextrading.com/theme/images/multi013.jpg" alt="Loading" name="img" width="202" height="142" border="0" align="top" id="img"/></td>';
						}	
						tdHtml += '</tr>';						
						tdHtml += '</table>';

						document.getElementById("answer").innerHTML = tdHtml;
					
				}
				
    	}
    }
	function showDiv(id)
	{
		document.getElementById(id).style.display = '';
	}
	function hideDiv(id)
	{
		document.getElementById(id).style.display = 'none';
	}

