$(document).ready(function(){
	$('#searchform').seacrhFs();
});

/** This function sets the default value 
* to the search site wide field. When no value
* is filled in, or the default text is still present
* the search will not be executed when the
* form is submitted
*/
if(jQuery) (function(c){
	$.fn.seacrhFs = function(params){
		var conf = $.extend({
			textInput:'#query',
			valueDef:'span'
		}, params);
		return this.each(function(){
			var c=conf,o=$(this),i=o.find(c.textInput),t=o.find(c.valueDef).html();
			if(t==null){t='Stel uw vraag'};
			if(i.val()==''){i.val(t)};
			o.submit(function(){
				if((i.val()==t)||(i.val()=='')){
					return false;
				}
			});
			i.blur(function(){
				if(i.val()==''){
					i.val(t);
				}
			});
			i.focus(function(){
				if(i.val()==t){
					i.val('');
				}
			});
		})
	}
})(jQuery);