var searchPromptText = "Enter Key Word";


function ClearTextFromInput(textBox,promptText)
{
	if(textBox)
	{	
		if (textBox.value.toLowerCase() == promptText.toLowerCase())
		{
			textBox.value = "";
		}
	}
}

function ResetInputText(textBox,promptText)
{
	if (textBox)
	{
		if (textBox.value == "")
		{
			textBox.value = promptText;
		}
	}
}

function getkey(e)
{
	if (window.event)
	{
		return window.event.keyCode;
	}
	else if (e)
	{
		return e.which;
	
	}
	else
    {
		return null;
	}
}

function StopBubbling(e)
{
	if(window.event && window.event.cancelBubble != null)
	{
		window.event.cancelBubble = true;
	}
	else if(e && e.stopPropogation)
	{
		e.stopPropogation();
	}
}

function onInputKeyPress(e, inputTextBox, inputButton, inputPromptText)
{
	if (getkey(e) == 13)
	{
		StopBubbling(e);
		if((inputTextBox.value != "") && (inputTextBox.value != inputPromptText))
		{
			//alert("searching");
			var button = document.getElementById(inputButton);
			if (button)
			{
				button.click();
			}
			return false;
		}
		else 
		{
			//alert("not searching");
			return false;
		}
	}
	else
	{
		return true;
	}
}