var starttimerl
$(document).ready(function(){
	//$('li.subactive1').find('a:first').html('&nbsp;');
	$('#ajaxSearch_submit').attr('value', '');
	$.jFastMenu("#menu");
	
	//alert(location.hash.length);
	if(location.hash=="#verstuurd") {
		alert('Je bericht is verstuurd.');
	}
});

$(window).load(function() {
	if($('#hpteaser1').length>0){
		t1=$('#hpteaser1').height();
		t2=$('#hpteaser2').height();
		newh = t1;
		if(t2>t1){newh = t2}
		$('#hpteaser1, #hpteaser2').height(newh);
	};
	$('#mailafriendlink, #closeform').click(function() {
		var topY = $('#mailafriend').css('top');
		if(topY=='-700px'){
			$('#mailafriend').css({opacity: 0});
			$('#mailafriend').animate({top: '37px', opacity: 1 }, 600, 'easeout' );
		} else {
			$('#mailafriend').animate({top: '-700px', opacity: 0 }, 400, 'easein' );
		}
		
	});
	var url = document.location.toString();
	if (url.match('#verstuurd')) {
    	$('#mailafriend').animate({top: '-700px', opacity: 0 }, 400, 'easein' );
    }
	
});


jQuery.jFastMenu = function(id){

	$(id + ' ul li').hover(function(){
		//$(this).find('ul:first').stop();
		//$(this).find('ul:first').animate({height:'show'}, {queue: false});
		
		$(this).find('ul:first').css({display:'block', opacity:1});
	},
	function(){
		//$(this).find('ul:first').animate({height:'hide'}, {queue: false});
		
		$(this).find('ul:first').css({display:'none', opacity:0});
	});

}

$.fn.extend({
  getUrlVars: function(){
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for(var i = 0; i < hashes.length; i++)
    {
      hash = hashes[i].split('=');
      vars.push(hash[0]);
      vars[hash[0]] = hash[1];
    }
    return vars;
  },
  getUrlVar: function(name){
    return $.getUrlVars()[name];
  }
});
