//IMPORTANT! This library assumes that the following libraries have been loaded by the calling page:
//	javascript_library.js
//	yui/build/yahoo/yahoo-min.js
//	yui/build/yahoo/dom-min.js
//	yui/build/yahoo/event-min.js
//	yui/build/yahoo/container-min.js

var m_HideSearchDialogTID;
var m_ShowSearchDialogTID;

YAHOO.namespace("container");

function YAHOOinitSearchDialog() {
	YAHOO.container.SearchDialog = 
		new YAHOO.widget.Panel("SearchDialog", { visible:false,
			iframe:false,
			constraintoviewport:true,
			close:false,
			draggable:false,
			modal:false,
			underlay:'shadow',
			height:'46px',
			width:'300px'
		} );

	YAHOO.container.SearchDialog.render();
}

YAHOO.util.Event.onDOMReady(YAHOOinitSearchDialog);

function ShowSearchDialog(Catalog, ContextId)
{	
	YAHOO.container.SearchDialog.cfg.setProperty('context', [ContextId,'tl','bl']);
	
	//IE hack: underlay size does not change with panel size; resize it now
	if(document.all) YAHOO.container.SearchDialog.sizeUnderlay();
	
	YAHOO.container.SearchDialog.show();
	
	document.SearchDialogForm.c.value = Catalog.toString();
}

function HideSearchDialog()
{
	m_HideSearchDialogTID = setTimeout('YAHOO.container.SearchDialog.hide();',700);
}

function SearchDialogLink_OnClick(Catalog, ContextId)
{
	clearTimeout(m_ShowSearchDialogTID);
	ShowSearchDialog(Catalog, ContextId);
	return false;
}

function SearchDialogLink_OnMouseOver()
{
	clearTimeout(m_HideSearchDialogTID);
}

function SearchDialogPanel_OnMouseOver()
{
	clearTimeout(m_HideSearchDialogTID);
	clearTimeout(m_ShowSearchDialogTID);
}

