$(document).ready(function ()
{
	$('h1 img').click(function ()
	{
		document.location = "/";
	});

	//REPLACE HR TAG
	$(".fckContent hr").wrap("<div class='replaceHr'></div>");
	$("hr.top").wrap("<div class='replaceHrtop'></div>");
	$("hr.bottom").wrap("<div class='replaceHrbottom'></div>");

	//productkiezer
	$('.extend').hide();
	$('#scroller li').hover(function ()
	{
		var i = $('#scroller li').index(this);
		$('.extend').eq(i).show();
		$('.simply-scroll-clip').css('height', '200px');
		$('#scroller li').eq(i).css('height', '200px');
		$('.extend').eq(i).click(function ()
		{
			var i = $('.extend').index(this);
			var currentHref = $('.simply-scroll .simply-scroll-list li a').eq(i).attr('href');
			document.location = currentHref;
		});
	}, function ()
	{
		var i = $('#scroller li').index(this);
		$('.extend').eq(i).hide();
		$('.simply-scroll-clip').css('height', '30px');
		$('#scroller li').eq(i).css('height', '30px');
	});


	//ZOEKVELD
	var defaultZoektext = ('zoek in deze site');
	var setZoektext = $('#searchwm').html();
	if (setZoektext == '')
		$('.zoekveld').attr('value', defaultZoektext);
	else
		$('.zoekveld').attr('value', setZoektext);

	$('.zoekveld').focus(function ()
	{
		var userInput = $(this).val();
		if (userInput == defaultZoektext)
		{
			$(this).val('');
		}
	});
	$('.zoekveld').blur(function ()
	{
		var userInput = $(this).val();
		if (userInput == '')
		{
			$(this).val(defaultZoektext);
		}
	});


	$("a.lbVideoLink").click(function (e)
	{
		e.preventDefault();
		var videoUrl = $(this).attr("href");
		if (videoUrl)
		{
			$('#iFrame').attr("src", videoUrl);
			$('#videoModalContent').modal({
				opacity: (75),
				closeHTML: ('<div class="divClose"><a class="modalCloseImg" title="Close"></a></div>'),
				closeClass: ("modalCloseImg"),
				position: [80, ]
			});

			$("#simplemodal-overlay").click(function (e)
			{
				e.preventDefault();
				$.modal.close();
			});
		}
	});

	$("a.lbOpenVideoLink").click(function (e)
	{
		e.preventDefault();

		$('#videoModalContent').modal({
			opacity: (75),
			closeHTML: ('<div class="divClose"><a class="modalCloseImg" title="Close"></a></div>'),
			closeClass: ("modalCloseImg"),
			position: [10, ]
		});

		$("#simplemodal-overlay").click(function (e)
		{
			e.preventDefault();
			$.modal.close();
		});
	});


	//OVERLAY
	$('#basicModal a.reacties').click(function (e)
	{
		e.preventDefault();
		//$('#reactiesModalContent').modal();
		$('#reactiesModalContent').show();
	});
	$('#basicModal a.nieuwsbrief').click(function (e)
	{
		e.preventDefault();
		$('#nieuwsbriefModalContent').modal({ persist: true, position: [30, ] });
	});
	$('#basicModal a.contact').click(function (e)
	{
		e.preventDefault();
		$('#contactModalContent').modal({ persist: true, position: [30, ] });
	});

	$('#basicModal a.meercontact').click(function (e)
	{
		e.preventDefault();
		$('#meerContactModalContent').modal({ persist: true, position: [30, ] });
	});

	$("#simplemodal-overlay ").click(function (e)
	{
		e.preventDefault();
		$.modal.close();
	});


	//SHOW PRINT
	$('.print').prepend('<a href="#Print"><img src="/Themes/default/images/ico-print.gif" /></a>');
	$('.print a').click(function ()
	{
		window.print();
		return false;
	});


});


NieuwsBrief = {
    close : function(){
        $.modal.close();
    }
}

NewsComments = {
    add : function(newsId){
        $('#reactiesModalContent').modal();
        return false;
    }
}





	

