// Performs Search
function Search()
{
	//var SearchText = document.Form1.search.value;
	var SearchText = (document.getElementById("searchText")).value;
	window.location.href = "/Search.aspx?searchtext=" + escape(SearchText);
}

// Variables for 'enter key press' functionality
var doSearch = false;

// Sets whether or not to search on 'enter key press'
function SetDoSearch(value)
{
	doSearch = value;
}

/*
// Sets function for 'enter key press'
if (document.all)
{     
	document.onkeydown = function ()
	{   
		var key_enter= 13; // 13 = Enter
		if (key_enter==event.keyCode)
		{
			event.keyCode=0;
			if(doSearch)
			{
				Search();
			}
			return false;
		}
	}
}
*/

// Sets function for 'enter key press'
function kH(e) 
{
	// Get the key code that was pressed (13 is the enter key)
	var pK = document.all? window.event.keyCode:e.which;

	if(doSearch && pK == 13)
	{
		Search();
	}
	
	return pK != 13;
}
document.onkeypress = kH;

//*************************************
// Functions for Print and Email Page
//*************************************
function PrintContent()
{
	window.open("/Print.html", "PrintPage");
}

function EmailPage(AliasPath)
{
	window.open('/Email.html?ap=' + AliasPath,'EmailPage','width=400,height=400,directories=no,menubar=no,location=no,resizable=yes,scrollbars=no');
}