$(document).ready(function() {
	var url = "http://rockanjelive.nl/";

	$("a[rel=fancybox], a[class=fotoalbumPic]").fancybox({
		overlayShow : false
	});
	var RockLiveDate = new Date("April 18, 2012 13:00:00");
	$('#countday').countdown({
		until : RockLiveDate,
		layout : '{dn} {dl}'
	});
	//layout : '<div class=\"dag\">{d<}{dn} {dl}</div><div class=\"uur\">{d>} {hn} {hl}</div>'
	//		layout : '<div class=\"dag\">{d<}{dn} {dl}</div><div class=\"uur\">{d>} {hn} {hl}</div><div class=\"minuten\">{mn} {ml}</div><div class=\"seconden\">{sn} {sl}</div>'

	$(".menu li").hover(function() {
		var rel = $(this).attr('rel');
		var el = $('#' + rel);
		var pos = $(this).offset();
		//alert(rel);
		if(el.length > 0) {
			el.fadeIn('fast')
		}
	}, function() {
		var rel = $(this).attr('rel');
		var el = $('#' + rel);

		el.fadeOut('fast')
	});

	$('a[rel=scroll]').click(function(e) {
		e.preventDefault();
		var ScrollID = $(this).attr('href');
		//alert(id);
		var top = $(ScrollID).offset().top;
		$('html,body').animate({
			scrollTop : top
		}, 1000);
		//$(window).scroll("#" + id);
	});

	$("input.example, textarea.example").example(function() {
		if($(this).attr('title') !== "" && $(this).attr('title') !== undefined) {
			return $(this).attr('title');
		}
	});

	$('.newsitem').hover(function() {
		var el = $(this).find('.text');
		var height = el.height() + 9;
		$(this).find('.text').animate({
			"margin-top" : -height,
		}, 100, function() {
			// Animation complete.
		});
	}, function() {
		$(this).find('.text').animate({
			"margin-top" : -100,
		}, 100, function() {
			// Animation complete.
		});
	});
	//http://maps.google.nl/maps?q=korteweg+11,+rockanje&hl=nl&sll=51.87671,4.056616&sspn=0.004544,0.00942&vpsrc=0&hnear=Korteweg+11,+Rockanje,+Westvoorne,+Zuid-Holland&t=m&z=16&iwloc=A

	$("#map").gMap({
		markers : [{
			latitude : 51.878675,
			longitude : 4.063182,
			html : '<b>Rockanje Live</b><br>Korteweg<br>3235CH Rockanje<br><br>Bij VV Rockanje',
			title : "Rockanje Live",
			popup : true
		}],
		zoom : 16,
		maptype: google.maps.MapTypeId.SATELLITE,		
    icon: {
        image: url+'img/gmap_icon.png',
        iconsize: [45, 85],
        iconanchor: [43, 82],
        infowindowanchor: [12, 0]
    }
	});

});

