function el(id){return document.getElementById(id);}
function showHide(id)
{
	id = el(id);
	
	if(id == undefined)
		return;
	
	if(id.style.display == 'none')
	{
		id.style.display = 'block';
	}
	else
	{
		id.style.display = 'none';
	}
}
function url(url){window.location = url;}
function nurl(url){window.open(url);}
function options()
{
	showHide('dropdownmenu');
	return false;
}

showHide('dropdownmenu');

function clearValue(id)
{
	if(el(id).value == 'zoeken...')
		el(id).value = '';
}
function fillValue(id)
{
	 if(el(id).value == '')
		el(id).value = 'zoeken...';
}

$('.tool div').each(function()
{
	end=false;

	if($(this).attr('id').substr(0,7) == 'optionC')
		var end = true;
	
	if($(this).attr('id') != '')
	{		
		$(this).hover(function()
		{
			$(this).addClass('hover');
			
			if(end)
				$('.tool div.end').addClass('hover');
				
		},function()
		{
			$(this).removeClass('hover');
			if(end)
				$('.tool div.end').removeClass('hover');
		});
	}
});


/*LENING TOOL*/
var slideWidth = 1000;
var slides = $('.tool');
var numberOfSlides = slides.length;
var result = '';

$('#toolwrapper').css('overflow', 'hidden');

slides.wrapAll('<div id="slideInner"></div>').css({
	'float' : 'left',
	'width' : slideWidth
});

$('#slideInner').css('width', slideWidth * numberOfSlides);

$('.tool div').bind('click', function(){
	result += '/'+$(this).attr('id').replace('option','');
	cur=$(this).attr('id').substr(7);
	
	if(cur==3)
	{
		url(rt+'Lening_offerte_aanvragen'+result);
	}
	else
	{
		$('#slideInner').animate({
			'marginLeft' : -(slideWidth*(cur))
		});
	}
});