function go(u)
{
        document.location = u;
}

function displayTotal(n)
{
        document.getElementById('numFound').innerHTML = 'Total Found: ' + n;
}

function clearTotal()
{
        document.getElementById('numFound').innerHTML = '';
}


function searchAgain()
{
        statusBar();
        ajaxEngine.sendRequest( 'searchAgain' )
}

function getBuyerDetail(t,r)
{
        // statusBar();
        out = t;
        document.location = 'getBuyerDetail.php?r=' + out + '&oldr=' + r;
	

}

function getAwardDetail(t,r)
{
        out = t;
        document.location = 'getAwardDetail.php?r=' + out + '&oldr=' + r;
}

function getSolDetail(r,t)
{
        out = r;        
        document.location = 'getSolDetail.php?r=' + out + '&oldr=' + t;
}

function statusBar()
{
	ostr = '<table width="97%" cellspacing="0" cellpadding="0">';
	ostr += '<tr><td align="right">';
	ostr += '<table border="0" cellpadding="2" cellspacing="0" width="200" align="right" style="border: 1px solid #000;">';
	ostr += '<tr style="font-size:12px; font-weight:bold;color:#000000;background-color:#f1f1f1; ">';
	ostr += '<td style="font-weight:bold;border-bottom: 1px solid #000; " width="200" align="center">Loading Results</td></tr>';
	ostr += '<tr><td style="font-size:10px" class="content" valign="center" align="center">';
	ostr += '<img hspace="5" vspace="5" src="images/sprocket.gif" /></td></tr>';
	ostr += '</table>';
	ostr += '</td></tr>';
	ostr += '</table><br/><br/>';
	// document.getElementById('fbiSearchResult').innerHTML = ostr;
        // ajaxEngine.sendRequest( 'statusBar' );
}

function getAgencyData(a,ac,b)
{
	document.location = 'agencyData.php?agency='+a+'&ac='+ ac+'&b=' + b;
	
}
function getOfficeData(a,o,ac,b)
{
	document.location = 'officeData.php?agency=' + a + '&office=' + o + '&ac='+ac + '&b='+b;
	
}
function performFbiSearch(t) {

                if(t != 'reset') 
                {
                checked = 0;    
                f = document.fbiSearch;
                out = 'keyword=' + escape(f.keywordIn.value) + '|';
                v = f.keywordIn.value;                  
                if(v.length > 2)
                        checked = 1;

                f = document.fbiSearch;
                out += 'solAwardNumber=' + escape(f.solAwardNumber.value) + '|';
                v = f.solAwardNumber.value;
                if(v.length > 2)
                        checked = 1;

                v = f.popPostalCode.value;                      
                if(v.length > 2)
                {
                        checked = 1;
                        out += 'popPostalCode=' + escape(f.popPostalCode.value) + '|';
                }

                out += 'typeIn=d|';

                for(x = 0;x < f.agency.options.length;x++)
                {
                        if(f.agency.options[x].selected)
                        {
                                if(f.agency.options[x].value != "")
                                {
                                        out += 'agency[]=' + f.agency.options[x].value + '|';
                                        checked = 1;
                                }
                        }
                }
                for(x = 0;x < f.classcode.options.length;x++)
                {
                        if(f.classcode.options[x].selected)
                        {
                                if(f.classcode.options[x].value != "")
                                {
                                        out += 'classCode[]=' + f.classcode.options[x].value + '|';
                                        checked = 1;
                                }
                        }
                }

                for(x = 0;x < f.stateIn.options.length;x++)
                {
                        if(f.stateIn.options[x].selected)
                        {
                                if(f.stateIn.options[x].value != "")
                                {
                                        out += 'stateIn[]=' + f.stateIn.options[x].value + '|';
                                        checked = 1;
                                }
                        }
                }

               for(x = 0;x < f.stateInCo.options.length;x++)
                {
                        if(f.stateInCo.options[x].selected)
                        {
                                if(f.stateInCo.options[x].value != "")
                                {
                                        out += 'stateInCo[]=' + f.stateInCo.options[x].value + '|';
                                        checked = 1;
                                }
                        }
                }

                for(x = 0;x < f.naicsCode.options.length;x++)
                {
                        if(f.naicsCode.options[x].selected)
                        {
                                if(f.naicsCode.options[x].value != "")
                                {
                                        out += 'naicsCode[]=' + f.naicsCode.options[x].value + '|';
                                        checked = 1;
                                }
                        }
                }

                        if(checked == 1)
                        {
                                // statusBar();
                                // ajaxEngine.sendRequest( 'performFbiSearch','r=' + out);
				document.location = 'performFbiSearch.php?r='+ out;
                        }
                }
}
