jQuery(document).ready(function() {
			jQuery('.search_menu').hover(
			  function () {
				jQuery('.floated_right_menu2').addClass('floated_right_menu2_active');
				jQuery('.search-block-wrap').css('visibility','visible');
			  }, 
			  function () {
				jQuery('.floated_right_menu2').removeClass('floated_right_menu2_active');
				jQuery('.search-block-wrap').css('visibility','hidden');
			  }
			);
			jQuery('.search-block-wrap').hover(
			  function () {
				jQuery('.floated_right_menu2').addClass('floated_right_menu2_active');
				jQuery('.search-block-wrap').css('visibility','visible');
			  }, 
			  function () {
				jQuery('.floated_right_menu2').removeClass('floated_right_menu2_active');
				jQuery('.search-block-wrap').css('visibility','hidden');
			}
			);

			jQuery(this).find('.submenu-producten-cat2').each(function(){
				width = 0;
				jQuery(this).find('a').each(function(){
					if(width < $(this).width()) width = $(this).width();
				});
				jQuery(this).css('width',(width+25)+'px');
				jQuery(this).css('left',($(this).prev().find('span').width()+30)+'px');
			});
			jQuery('.submenu').hide();
			jQuery('.submenu-producten-cat2').hide();
			jQuery(this).find('.submenu').css('visibility','visible');
			jQuery(this).find('.submenu-producten-cat2').css('visibility','visible');
			jQuery(this).find('.submenu-producten-cat2').css('position','absolute');

			jQuery('#navigation').find('li').hover(
			  function () {
				jQuery(this).find('a:first').addClass('menu-extra');
				jQuery(this).find('.submenu2').show();
			  }, 
			  function () {
				jQuery(this).find('.submenu2').hide();
				jQuery(this).find('a:first').removeClass('menu-extra');
			  }
			);

			jQuery('.producten-item').hover(
			  function () {
				jQuery('.producten-item').addClass('menu-extra2');
				jQuery('.submenu-producten').show();
			  }, 
			  function () {
				jQuery('.submenu-producten').hide();
				jQuery('.producten-item').removeClass('menu-extra2');
			  }
			);
			jQuery('.submenu-producten').hover(
			  function () {
				jQuery('.producten-item').addClass('menu-extra2');
				jQuery('.submenu-producten').show();
			  }, 
			  function () {
				jQuery('.submenu-producten').hide();
				jQuery('.producten-item').removeClass('menu-extra2');
			  }
			);
			jQuery('.submenu-producten-cat2-item').hover(
			  function () {
				jQuery(this).find('a:first').addClass('menu-extra3');
				jQuery(this).find('.submenu-producten-cat2').show();
			  }, 
			  function () {
				jQuery(this).find('.submenu-producten-cat2').hide();
				jQuery(this).find('a:first').removeClass('menu-extra3');
			  }
			);
			
			
		});
		
jQuery(document).ready(function() {
	jQuery('.question').hover(
			  function () {
				jQuery(this).parent().find('.question-answer').show();
			  }, 
			  function () {
				jQuery(this).parent().find('.question-answer').hide();
			  }
			);
	jQuery('.question-answer').hover(
			  function () {
				jQuery(this).parent().find('.question-answer').show();
			  }, 
			  function () {
				jQuery(this).parent().find('.question-answer').hide();
			  }
			);
	jQuery('.question2').hover(
			  function () {
				jQuery('.question2-answer').show();
			  }, 
			  function () {
				jQuery('.question2-answer').hide();
			  }
			);
	jQuery('.question2-answer').hover(
			  function () {
				jQuery('.question2-answer').show();
			  }, 
			  function () {
				jQuery('.question2-answer').hide();
			  }
			);
	function findValueCallback(event, data, formatted) {
		jQuery("<li>").html( !data ? "No match!" : "Selected: " + formatted).appendTo("#result");

	}
	function formatItem(row) {
		return row[0] + " (<strong>id: " + row[1] + "</strong>)";
	}
	function formatResult(row) {
		return row[0].replace(/(<.+?>)/gi, '');
	}
	jQuery("#suggest2").autocomplete(site+'js/ajax2.php',{
		minChars: 0,
		max: 10,
		url: site+'js/ajax2.php',
		autoFill: false,
		mustMatch: false,
		matchContains: false,
		scrollHeight: 220
	});	
	
	
	jQuery("#suggest1").autocomplete(site+'js/ajax.php',{
		minChars: 0,
		max: 10,
		url: site+'js/ajax.php',
		autoFill: false,
		mustMatch: false,
		matchContains: false,
		scrollHeight: 220
	});	
	
	jQuery("#clear").click(function() {
		jQuery(":input").unautocomplete();
	});	
});
function search(site){
	var word1 = jQuery('#suggest1').val();
	var word2 = jQuery('#suggest2').val();
	var min = jQuery(".proj_min").val();
	var max = jQuery(".proj_max").val();
	jQuery.ajax({
		type: "POST",
		url: site+"js/ajax.php",
		data: "search=yes&word1="+word1+"&word2="+word2+"&min="+min+"&max="+max+"",
		success: function(msg){
				window.location = site+'zoekresultaten';
		}
	});
}
function changeCat(site,cat){
	jQuery.ajax({
		type: "POST",
		url: site+"js/ajax.php",
		data: "cat="+cat+"",
		success: function(msg){
			if (msg) {
				window.location = msg;
			}
		}
	});
}
function changeText(text,ref){
	if(ref.value == text) ref.value = '';
}
function changeText2(text,ref){
	if(ref.value == '') ref.value = text;
}
function getResults(cat,min,max,site){
	/*
	jQuery.ajax({
		type: "POST",
		url: site+"js/ajax.php",
		data: "cat="+cat+"&min=" + min + "&max="+max+"",
		success: function(msg){
			if (msg != '') {
				window.location = site+'zoekresultaten';
			}
		}
	});
	*/
}
