function god(url)
{
	window.location=url 
}

function go(url)
{
	//window.location=url 

	window.status="have a cigar";
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	} 
	with(document.forms[0])
	{
		//var encodewsurl = URLEncode(wsurl.value);
		url += "&callback=1";
		url += "&sid="+Math.random();
		//alert(url);
		xmlHttp.onreadystatechange=function() {WScallback();};
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}	
}

function WScallback()
{
	window.status="please wait... have a cigar";
	if (xmlHttp.readyState==4)
	{ 
		var scriptResult = xmlHttp.responseText;
		var reg = new RegExp(ajaxseparation, "g");
		var tableau = scriptResult.split(reg);
//		if (task == webpagedisplay)
//		{
			document.getElementById("blabla").innerHTML = tableau[0];
			document.getElementById("menuitem").innerHTML = tableau[1];
			document.getElementById("menutop").innerHTML = tableau[2];
			document.getElementById("menubottom").innerHTML = tableau[3];
			document.getElementById("moremsg").innerHTML = tableau[4];
			//window.location = "#top"
			window.status="you're welcome";
//		}
	}
}

function enterC(e)
{
	var keynum = 0
	if(window.event) // IE
		keynum = e.keyCode
	else if(e.which) // Netscape/Firefox/Opera
		keynum = e.which
	if (keynum == 13)
		subscribeC()
	else
		return true
}

function subscribeC()
{
	if (validate_customer())
	{
		 go('NBWebStoreAJAX.php?subscribe=1&email='+document.getElementById("email").value)

		/*var thisform = document.forms[0]
		with(thisform)
		{
			subscribe.value=1
			submit()
		}*/
	}
}

var refine = "refine"
function validate_form(thisform)
{
	with (thisform)
	{
		searchType.value=refine
	}
	return true
}

function wssearch(thefield, thing)
{
	with (document)
	{
		var f = getElementById(thefield)
		if (f.value.length > 0)
		{
			//forms[0].searchType.value=refine
			//forms[0].submit()
			var searchValue=document.getElementById(thefield).value
			go('NBWebStoreAJAX.php?searchType='+refine+
			 						'&filter='+searchValue+
			 						'&search='+thefield+
			 						'&'+thefield+'='+searchValue)
		}
		else
		{
			go('NBWebStoreAJAX.php?searchType='+thefield+
			 						'&search='+thefield)
		}
	}
}