// JScript source code

function hideSearchBox(e) {
	var targ;
	   e = (e) ? e : ((window.event) ? window.event : "")
			if (e) {
				if (e.target) {
				targ = e.target;
				}
				if (e.srcElement){
				targ = e.srcElement;
				}
			}
		    
	  while(targ.tagName != "DIV")
        {   
             if(targ.parentNode) 
             {
               targ = targ.parentNode;
             }
             else
             {
             break;
             }
        }
        
	 if (targ.id != 'SearchBoxDiv' && targ.id != 'SearchOptions')
	 {
		showDiv('SearchOptions', 0);
	 }
}

document.onclick = hideSearchBox;
//document.onmouseout = hideSearchBox;
	
function showDiv(ID, iState) // 1 visible, 0 hidden
{
	var searchDiv = document.getElementById('SearchOptions');
	var searchBox = document.getElementById('navSearch_SearchBox');
	//searchDiv.style.top = searchBox.style.top + 143;
	document.getElementById(ID).style.display = iState ? "" : "none";
}

function GetSections()
{
	var sections = "";
	if (document.getElementById('navSearch_sections_0').checked)
	{
	sections = sections + '1';
	}
	else
	{
	sections = sections + '0';
	}
	
	if (document.getElementById('navSearch_sections_1').checked)
	{
	sections = sections + ',1';
	}
	else
	{
	sections = sections + ',0';
	}
	
	if (document.getElementById('navSearch_sections_2').checked)
	{
	sections = sections + ',1';
	}
	else
	{
	sections = sections + ',0';
	}
	
	if (document.getElementById('navSearch_sections_3').checked)
	{
	sections = sections + ',1';
	}
	else
	{
	sections = sections + ',0';
	}
	
	if (document.getElementById('navSearch_sections_4').checked)
	{
	sections = sections + ',1';
	}
	else
	{
	sections = sections + ',0';
	}
	
	if (document.getElementById('navSearch_sections_5').checked)
	{
	sections = sections + ',1';
	}
	else
	{
	sections = sections + ',0';
	}
	
	if (document.getElementById('navSearch_sections_6').checked)
	{
	sections = sections + ',1';
	}
	else
	{
	sections = sections + ',0';
	}

	return sections;
}

function clear_textbox(item, text)
{
if (item.value == text)
item.value = "";
} 