

/* Unobtrusive OnLoad */
function addLoadListener(fn)
{
	if(typeof(window.addEventListener) != 'undefined')
	{
		window.addEventListener('load', fn, false);
	}
	else if(typeof(document.addEventListener) != 'undefined')
	{
		document.addEventListener('load', fn, false);	
	}
	else if(typeof(window.attachEvent) != 'undefined')
	{
		window.attachEvent('onload', fn);	
	}
	else
	{
		var oldfn = window.onload;
		
		if(typeof(window.onload) != 'function')
		{
			window.onload = fn;	
		}
		else
		{
			window.onload = function(){
				oldfn();
				fn();
			};
		}
	}
}


/* Search form functionality */
var search_DefaultValue = "Try our new search";

function search_InitForm()
{
	var theForm = document.getElementById("search_form");
	theForm.Ntt.value = search_DefaultValue;
}

function search_ValidateForm(e)
{
	var theForm = document.getElementById("search_form");
	
	if(theForm.Ntt.value == search_DefaultValue || theForm.Ntt.value.replace(' ','') == "")
	{
		alert("Please enter a search term");
		theForm.Ntt.focus();
		if (e && e.preventDefault)
			e.preventDefault(); // DOM style
		return false; // IE style
	}
	else 
		return true;
}
/* End Search form functionality */
