function VT(s)
    {
    var m = s.match(/^\s*(\S+(\s+\S+)*)\s*$/);
    return (m == null) ? "" : m[1];
    }
    
function searchFAQs(_x)
    {
    var obj;
    if(_x==2)
        obj = document.getElementById('query2');
    else
        obj = document.getElementById('query');
    var query = obj.value;
    if (query.match(/^\s*(\S+(\s+\S+)*)\s*$/) == null)
        {
        alert('Please type the search word(s).')
        obj.focus();
        return false;
        }
    document.getElementById('searchParam').style.display='none';
    document.getElementById('loader').style.display='block';
    document.getElementById('searchResult').style.display='none';
    if (/MSIE (\d+\.\d+);/.test(navigator.userAgent))
        showModal('FAQDIV', 35, 8);
    else
        showModal('FAQDIV');    
    xmlHttp = GetXmlHttpObject();
	if (xmlHttp == null)
	    {
		alert ("Browser does not support HTTP Request");
		return;
		} 

	xmlHttp.onreadystatechange = loadFAQ;
	if(_x==2)
    	xmlHttp.open("GET", 'searchFAQs.aspx?r=' + Math.random() + '&query=' + escape(encodeURI(obj.value)) + '&searchOp=' + document.getElementById('searchOpX1').checked , true);
    else
        xmlHttp.open("GET", 'searchFAQs.aspx?r=' + Math.random() + '&query=' + escape(encodeURI(obj.value)) + '&searchOp=' + document.getElementById('searchOp1').checked , true);
	
	xmlHttp.send(null);		
    obj.value='';
    document.onkeypress = ProcessKeypress;            
    }    
    
	function loadFAQ() 
		{ 
		if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete")
		    {
			document.getElementById('searchResult').innerHTML=xmlHttp.responseText;
			document.getElementById('loader').style.display='none';
			document.getElementById('searchParam').style.display='block';			
			document.getElementById('searchResult').style.display='block';
			}
		}    
    
    function closeFAQ()
        {
        document.getElementById('dimmer').style.visibility='hidden';
        document.getElementById('FAQDIV').style.visibility='hidden'; 
        return false;
        }            
    function ProcessKeypress(e)
        {
		var code;
	    if (!e) var e = window.event;
	    if (e.keyCode) code = e.keyCode;
	    else if (e.which) code = e.which;
        if(code==27)closeFAQ();
        } 