function loadSearchForm(sType) {
	//Load form
	new Ajax.Updater('main_search_form', 'forms/'+sType+'.inc.php', { method: 'get' });
	//Make all items inactive
	var menuItems = $('menu').getElementsByClassName('active');
	for (i=0;i<menuItems.length;i++) {
  		menuItems[i].className = 'not_active';
	}
	//Make item active
	$('klik_'+sType).className = 'active';
}
function showGoogle(sSearchFor) {
	var win = new Window({className: "bluelighting", title: "Google Resultaten", width:500, height:400, url: "http://www.google.nl/search?q="+sSearchFor, showEffectOptions: {duration:1.5}}); 
	win.showCenter(); 
}
function showRDW(sSearchFor) {
	var win = new Window({className: "bluelighting", title: "Kenteken Gegevens", width:700, height:600, url: "helper/rdw_submit.php?txtKenteken="+sSearchFor, showEffectOptions: {duration:1.5}});
	win.showCenter(); 
}
function ajaxError() {
	alert('Er is een fout opgetreden bij de Ajax Request.');
}
//New version
function loadPage(iPage) {
	try {
		var sLastSearch = $F($('last_search'));
	}
	catch(err)
	{
	 return false;
	}
	showResults(sLastSearch,true,iPage,bNoMapsSave,sParamsSave); 
}
function setGoogleMap(sAdres,sPostcode,sStad,sLand,sDesc) {
	$('regionaam').update(sStad);
	frames['google_map'].location.href = 'core/map.inc.php?adres='+sAdres+'&postcode='+sPostcode+'&stad='+sStad+'&land='+sLand+'&desc='+sDesc;
	return true;
}
function selectResult(iNum) {
	results = $$('.active_result'); 
	for (i=0;i<results.length;i++) {
		var item = results[i];
		if (item.id!='result_'+iNum) {
			item.className='result';
			new Effect.Morph(item, { 
			style: {
				backgroundColor: '#FFFFFF'
			}
			});
		}
	}
	$('result_'+iNum).className = 'active_result';
	new Effect.Morph('result_'+iNum, { 
			style: {
				backgroundColor: '#CFE8F4'
			}
		});
	//Now change map
	return setGoogleMap($('data_adres_'+iNum).value,$('data_postcode_'+iNum).value,$('data_stad_'+iNum).value,$('data_land_'+iNum).value,$('data_naam_'+iNum).value);
}
//Load a normal page with content
function loadContent(sPage) {
	new Ajax.Updater('contentarea', 'pages/'+sPage+'.php', { method: 'get' });
	new Effect.Appear('contentpage'); 
}
//Load a normal page with content in a popup
function loadContentPopup(sPage) {
	win = new Window({className: "bluelighting", title: "Informatie", width:500, height:600, url:"pages/"+sPage+".php", destroyOnClose: true, recenterAuto:false});
	win.showCenter();
}
//Favorieten
function favorieten(url, title) {
	if (window.sidebar) {
	// Mozilla Firefox Bookmark
	window.sidebar.addPanel(title, url,"");
	} else if( window.external ) {
	// IE Favorite
	window.external.AddFavorite( url, title);
	}
	else if(window.opera && window.print) {
	// Opera Hotlist
	return true; }
}
function showUrl(sUrl) {
	var win = new Window({className: "bluelighting", title: "Externe pagina", width:500, height:400, url: sUrl, showEffectOptions: {duration:1.5}}); 
	win.showCenter(); 
}
function showUrlGroot(sUrl) {
	var win = new Window({className: "bluelighting", title: "Externe pagina", width:800, height:600, url: sUrl, showEffectOptions: {duration:1.5}}); 
	win.showCenter(); 
}