function InitSearch()
{
	if( getCookie("first_load") == "1" )
	{
		setCookie("first_load", "0");
		document.all.UserRestriction.value = getCookie("query");
		document.forms[0].submit();
	}
} 

function InitSearchAsp(query, first_load)
{
	setCookie("query", query);
	setCookie("first_load", first_load);
	
	document.location.href = "search.htm";
}

function ClearSearch()
{
	document.all.UserRestriction.value = "";
}

function setCookie(name, value)
{
	document.cookie = name + "=" + escape(value);
}

function getCookie(name)
{
	var value = null;
	
	var strCookie = "" + document.cookie + ";";
	var strSearch = "" + name + "=";
	
	var nStart = strCookie.indexOf(strSearch);
	var nEnd;
	
	if (nStart != -1)
	{
		nStart += strSearch.length;
		nEnd = strCookie.indexOf(";", nStart);
		value = unescape(strCookie.substring(nStart, nEnd));
	}
	
	return value;
}

function doSearch() {
	strSite = new String;
	strSite = document.all.what.value;
	if(strSite == "this site")
	{
		window.open("http://www.newconceptgroup.com/search.asp?query=" + document.all.name.value + "&first_load=1");
	}
	else if(strSite == "yahoo")
		window.open("http://google.yahoo.com/bin/query?p=" + document.all.name.value);
	else if(strSite == "altavista")
		window.open("http://www.altavista.com/sites/search/web?q=" + document.all.name.value);
}

