function zoek(iPaginaId)
{
	var headlines = document.getElementById("headlines");
	if(document.getElementById("headlines"))
	{
			var headlines = document.getElementById("headlines");
	}
	else
	{
			var headlines = document.getElementById("standoverzicht");
	}
	if(document.getElementById("newsitemcontent"))
 	{
	 	document.getElementById("newsitemcontent").innerHTML = "";
	}
	var sSearchValue =  document.getElementById("zoekveld").value;
	var req = ajaxFunction();
	req.open("POST", "zoeken.php", true);
	req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	headlines.innerHTML = '';
	headlines.innerHTML = "<div id='loading'><img src='img/loading.gif' />&nbsp;&nbsp;Een moment geduld...</div>"
	req.send('&DatabaseSearchNeedle=' + sSearchValue);
	req.onreadystatechange=function()
	{
		if(req.readyState == 4) 
		{
			//Verbinding in orde
			if (req.status == 200)
			{
					headlines.innerHTML = req.responseText;
					
					aTitles = fGetElementsByName_IE('div', "nieuwstitle");
					
					for (var iIndex=0; iIndex < aTitles.length; iIndex++)
					{
							if (iPaginaId == 1 || iPaginaId == 2)
							{
								aTitles[iIndex].style.color = "#84b92c";
								aTitles[iIndex].style.fontSize = "10px";
							}
							if (iPaginaId == 3 || iPaginaId ==6)
							{
								aTitles[iIndex].style.color = "#e02422";
								aTitles[iIndex].style.fontSize = "10px";
							}
							if (iPaginaId == 5)
							{
								aTitles[iIndex].style.color = "#0ba4c6";
								aTitles[iIndex].style.fontSize = "10px";
							}
							if (iPaginaId == 4 || iPaginaId ==7)
							{
								aTitles[iIndex].style.color = "#0d2669";
								aTitles[iIndex].style.fontSize = "10px";
							}
					}
					aDates = fGetElementsByName_IE('div', "divdatum");
					
					for (var iIndex=0; iIndex < aDates.length; iIndex++)
					{
							//alert(aTabs[iIndex]);
							if (iPaginaId == 1 || iPaginaId == 2)
							{
								aDates[iIndex].style.color = "#84b92c";
							}
							if (iPaginaId == 3 || iPaginaId ==6)
							{
								aDates[iIndex].style.color = "#e02422";
							}
							if (iPaginaId == 5)
							{
								aDates[iIndex].style.color = "#0ba4c6";
							}
							if (iPaginaId == 4 || iPaginaId ==7)
							{
								aDates[iIndex].style.color = "#0d2669";
							}
					}
			}
		}
	}
}

function zoekEnter(e,iPaginaId)
{
	
     var key;

     if(window.event)
          key = window.event.keyCode;     //IE
     else
          key = e.which;     //firefox

     if(key == 13)
		 {
		 			zoek(iPaginaId);
          return false;
		 }
     else
          return true
}