//////////////////////////////////////////////////////////////////////////////////////////////
function search() 
//////////////////////////////////////////////////////////////////////////////////////////////
{	
	searchToken = document.getElementById("searchTokenInput").value
	recordId = ""
	document.location = buildURL(demoID, null, searchToken)
}

/////////////////////////////////////////////////////////////////////////////////////////////
function checkForSubmit( event )
/////////////////////////////////////////////////////////////////////////////////////////////
{
	var keyCode = (dbNetPage.isIE) ? event.keyCode : event.which
	
	if (keyCode == 13)
		search()
}

/////////////////////////////////////////////////////////////////////////////////////////////
function showAnswer(e)
/////////////////////////////////////////////////////////////////////////////////////////////
{
	var table = document.getElementById("faq" + e)
	table.rows[2].style.display = 'none'
	table.rows[3].style.display = ''
}

/////////////////////////////////////////////////////////////////////////////////////////////
function hideAnswer(e)
/////////////////////////////////////////////////////////////////////////////////////////////
{
	var table = document.getElementById("faq" + e)
	table.rows[2].style.display = ''
	table.rows[3].style.display = 'none'
}

var opopup, win

/////////////////////////////////////////////////////////////////////////////////////////////
function runExample(e)
/////////////////////////////////////////////////////////////////////////////////////////////
{
	var width = parseInt(window.screen.availWidth * 0.8)
	var height = parseInt(window.screen.availHeight * 0.8)
	var url = '/shared/run_example.aspx?'

	if (document.frames)
	{
		if (document.frames.length != 0)
		{
			url += "url=" + document.frames[0].document.location.href
		}
		else
			url += "faqid=" + e
	}
	else
	{
		if (window.length != 0)
		{
			url += "url=" + window.frames[0].document.location.href
		}
		else
			url += "faqid=" + e
	}
	
	window.open(url, null, "width=" + width + ",height=" + height + ", status=no, help=no, resizable=yes");
}

//////////////////////////////////////////////////////////////////////////////////////////////
function getElementById(rootNode, id)
//////////////////////////////////////////////////////////////////////////////////////////////
{
	if (rootNode == null) alert("root node is null " + id)
	if (rootNode.all)
		return rootNode.all[id];
	else
	{
		if (rootNode.getElementsByTagName) 
		{		
			var all = rootNode.getElementsByTagName('*');	
			for (i=0; i < all.length; i++) 
			{
				if (all[i].getAttribute)
					if (all[i].getAttribute('id'))
						if (all[i].getAttribute('id').toLowerCase() == id.toLowerCase()) 
							return all[i];	
			}
		}	
	}
	return null;
}
