$(document).ready(function(){
	$('#menu-links-0').superfish()
	$('#menu-rechts-0').superfish()
})

var parkimpressie = new Array();
parkimpressie[0] = ['/media/upload/fadeshows/parkimpressie/1.jpg','',''];
parkimpressie[1] = ['/media/upload/fadeshows/parkimpressie/2.jpg','',''];
parkimpressie[2] = ['/media/upload/fadeshows/parkimpressie/3.jpg','',''];
parkimpressie[3] = ['/media/upload/fadeshows/parkimpressie/4.jpg','',''];
parkimpressie[4] = ['/media/upload/fadeshows/parkimpressie/5.jpg','',''];

$(document).ready(function(){
	$('#datepicker').datepicker()
	//	$('.menubalk ul.sf-menu li ul.sf-menu')
	$('.placeholder-parkenlijst ul li').mouseover(function(){
		$(this).css('background-image','url(/static/img/vlinder_klein.png)')
	}).mouseout(function(){
		$(this).css('background-image','none')
	})
	$('#beschikbaarheidslijst p:odd, .lastminutes div:odd').addClass('onevenP')
	$('.knop-direct-boeken').mouseover(function(){
		$(this).css('src','/static/img/verhuur/bg-knop-boeken-over.gif')
	}).mouseout(function(){
		$(this).css('src','/static/img/verhuur/bg-knop-boeken.gif')
	})
	$('.aanbieding').mouseover(function(){
		$(this).css('background-image','url(/static/img/verhuur/bg-lastminute-over.gif)')
	}).mouseout(function(){
		$(this).css('background-image','url(/static/img/verhuur/bg-lastminute.gif)')
	})
	$('.knop-direct-boeken').mouseover(function(){
		$(this).attr('src','/static/img/verhuur/knop-direct-boeken-over.gif')
	}).mouseout(function(){
		$(this).attr('src','/static/img/verhuur/knop-direct-boeken.gif')
	})
	$('.knop-meer-aanbiedingen').mouseover(function(){
		$(this).attr('src','/static/img/verhuur/bg-knop-aanbiedingen-over.gif')
	}).mouseout(function(){
		$(this).attr('src','/static/img/verhuur/bg-knop-aanbiedingen.gif')
	}).click(function(){
		location.href = '/17/verhuur/lastminutes/'
	})
	$('.meer-info-links').mouseover(function(){
		$(this).attr('src','/static/img/makelaardij/droomdeal-meerinfo-links-o.gif')
	}).mouseout(function(){
		$(this).attr('src','/static/img/makelaardij/droomdeal-meerinfo-links.gif')
	})
	$('.meer-info-rechts').mouseover(function(){
		$(this).attr('src','/static/img/makelaardij/droomdeal-meerinfo-rechts-o.gif')
	}).mouseout(function(){
		$(this).attr('src','/static/img/makelaardij/droomdeal-meerinfo-rechts.gif')
	})
	$('#makelaardij_content div.dir, #makelaardij_content div.esq').each(function(){
		$(this).addClass('om-en-om-me').removeClass('esq').removeClass('dir')
	})
	$('.om-en-om-me:odd').addClass('dir')
	$('.om-en-om-me:even').addClass('esq')
	$('.chalet:even').addClass('rijEven').corner('round 20px cc:#ffffff').css('background','#ffffff')
	$('.chalet:odd').addClass('rijOneven').corner('round 20px cc:#efefef').css('background','#efefef')
	$('.rijEven .chaletFoto').corner('round 12px cc:#ffffff')
	$('.rijOneven .chaletFoto').corner('round 12px cc:#efefef')
	$('.thumbnail, .lastminute .imgWrap').corner('round 18px cc:#ffffff')

	if (ie_ie8 === true) {
		$('.accommodaties .accommodatie:odd .midden').css('float','left')
		$('.accommodaties .accommodatie:odd .thumbnail').css('float','right')
		$('.accommodaties .accommodatie:odd .thumbnail:first').css('margin-top','12')
		$('.accommodaties .accommodatie:even .thumbnail').css('float','left')
		$('.accommodaties .accommodatie:even .thumbnail:first').css('margin-top','12')
		$('.meerAccInformatie:even').css('float','left').css('margin-left','20px').css('margin-top','-10px').css('clear','both')
		$('.meerAccInformatie:odd').css('float','right').css('margin-left','28px').css('clear','both')
		$('.accommodaties .accommodatie:odd #floaterMe').css('float','left')
		$('.accommodaties .accommodatie:even #floaterMe').css('float','right')
	} else {
		$('.accommodaties .accommodatie:odd .midden').css('float','left')
		// $('.accommodaties .accommodatie:odd .thumbnail').css('float','right')
		// $('.accommodaties .accommodatie:odd .thumbnail:first').css('margin-top','12')
		// $('.accommodaties .accommodatie:even .thumbnail').css('float','right')
		// $('.accommodaties .accommodatie:even .thumbnail:first').css('margin-top','12')
		 $('.meerAccInformatie:even').css('float','right').css('margin-left','-20px')
		$('.meerAccInformatie:odd').css('float','right').css('margin-left','28px').addClass('grote-knop-floater')
		$('.meerAccInformatie').css('margin-top','-25px')
	}

	$('.hoverGIF').mouseover(function(){
		var bron = $(this).attr('src')
		$(this).attr('src',bron.replace('.gif','-over.gif'))
	}).mouseout(function(){
		var bron = $(this).attr('src')
		$(this).attr('src',bron.replace('-over.gif','.gif'))
	}).css({
		cursor: 'pointer'
	})
	$('#doRemove').click(function(){
		$('#splashscreen-wrapper').remove()
	})
	$('#doRemove').css({
		'float': 'right'
	})
	$('#splashscreen-wrapper').css({
		'text-align': 'center',
		'z-index': '999999',
		'position': 'absolute',
		'overflow': 'hidden',
		'background': 'url(/static/img/poptrans.jpg) center top',
		'width': '100%',
		'height': '100%',
		'left': '0px',
		'top': '0px',
		'bottom': $(window).height(),
		'right': $(window).width()
	})
	var hoogte = $(window).height()
	var breedte = $('#splashscreen a:last img').width()
	hoogte = Math.round(hoogte - $('#splashscreen').height()) / 2 - 20
	$('#splashscreen').css({
		'margin': '0 auto',
		'width': breedte,
		'margin-top': hoogte
	})
	$('#lastminutes .lastminute:odd').css('background-color','#edf5ff')
	$('.direct-boeken').mouseover(function(){
		$(this).animate({
			'width': '145px'
		}, 150)
	}).mouseout(function(){
		$(this).animate({
			'width': '106px'
		}, 150)
	})
	if (typeof(affiliate_id) != "undefined") {
		$('li a').each(function(){
			href = $(this).attr('href')
			if ($(this).html().match('Verhuur') || $(this).html().match('verhuur')) {
				href += '?affiliate_id='+affiliate_id
				$(this).attr('href',href)
			}
		})
	}
})
