$(document).ready(function() {
	listmenu('witgoedmenu');

	/*var vak = function() {
		var vakElement = $('<div>Let op: wij zijn vrijdag 22 juli t/m zaterdag 6 augustus met vakantie. In deze periode kunt u uiteraard op onze website bestellen maar uw bestelling wordt pas maandag 8 augustus verwerkt. Heeft u een storing, dan kunt u ons altijd telefonisch bereiken.</div>').prependTo("#content").css({
			'border' : '1px solid black',
			'background-color' : '#FFFF99',
			'padding' : '4px',
			'margin-bottom' : '2px'
		})
		$('<img src="/systeem/afbeeldingen/cross.png" />').prependTo(vakElement).css({
			'float' : 'right',
			'cursor' : 'pointer'
		}).click(function() {
			$(vakElement).slideUp('slow', function() {
				$(vakElement).remove();
				$.setCookie('vakCookie', 'true', {
					path: '/',
					duration: 60*15
				});
			});
		});
	}
	var vakCookie = $.readCookie('vakCookie');
	if(vakCookie == null) {
		vak();
	}*/

	var w = 464;
	var marquee = $('<div></div>').appendTo("#header_block").css({
		position: 'absolute',
		left: '92px',
		top: '3px',
		width: w+'px',
		height: '35px',
		overflow: 'hidden',
		backgroundColor: 'white'
	});
	$('<div>www.witgoedderidder.nl</div>').appendTo(marquee);
	$('<div>Nieuw - Lekkerland</div>').appendTo(marquee).css({
		cursor: 'pointer'
	}).hover(
		function() {
			$(this).css({
				color: '#0011f3',
				textDecoration: 'underline'
			});
		},function() {
			$(this).css({
				color: '',
				textDecoration: 'none'
			});
		}
	).click(function() {
		window.open('http://maps.google.nl/maps?q=Nieuw+-+Lekkerland');
	});
	$('div',marquee).css({
		height: '35px',
		width: w+'px',
		textAlign: 'center',
		lineHeight: '35px',
		fontSize: '26px'
	}).each(function(i) {
		$(this).css({
			position: 'absolute',
			left: (i*w)+'px'
		});
	});
	function loop() {
		$('div',marquee).each(function(i) {
			var p = $(this).position();
			if(p.left + w <= 0) {
				$(this).css('left',w+'px');
				p = $(this).position();
			}
			$(this).animate({
				left: (p.left-w)+'px'
			},7500);
		});
		setTimeout(function() {
			loop();
		}, 10000);
	}
	setTimeout(function() {
		loop();
	}, 800);

	$('<div></div>').appendTo("#header_block").css({
		position: 'absolute',
		left: '307px',
		top: '71px',
		height: '18px',
		width: '250px',
		cursor: 'pointer'
	}).hover(
		function() {
			$(this).css('background','url(/systeem/afbeeldingen/header/email.png) no-repeat');
		},function() {
			$(this).css('background','none');
		}
	).click(function() {
		window.location.href = '/informatie/contact.xhtml';
	});

	$("#zoeken input:text").css('color','silver').val('Zoeken...');
	$("#zoeken input:text").focus(function() {
		if($("#zoeken input:text").val() == 'Zoeken...') {
			$("#zoeken input:text").val('').css('color','black');
		}
	}).blur(function() {
		if($("#zoeken input:text").val() == '') {
			$("#zoeken input:text").val('Zoeken...').css('color','silver');
		}
	});
	$("#zoeken form").submit(function() {
		if($("#zoeken input:text").val() == 'Zoeken...') {
			return false;
		} else if($("#zoeken input:text").val() == '') {
			return false;
		}
	});
});

