$(document).ready(function(){
	$('.splitcol').each(function(i){
		var colsize = Math.round($(this).find("li").size() / 2);
		$(this).find("li").each(function(i) {
			if (i>=colsize){
				$(this).addClass('splitcol_right');
			}
		}
		)
		$(this).find('.splitcol_right').insertAfter(this).wrapAll("<ul class='left'></ul>");
	}
	)
	
	$("a[rel^='photo']").prettyPhoto({animationSpeed: 'normal', /* fast/slow/normal */
				padding: 40, /* padding for each side of the picture */
				opacity: 0.35, /* Value betwee 0 and 1 */
				showTitle: true, /* true/false */
				allowresize: false, /* true/false */
				counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
				theme: 'light_rounded', /* light_rounded / dark_rounded / light_square / dark_square */
				hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */
				modal: false, /* If set to true, only the close button will close the window */
				changepicturecallback: function(){}, /* Called everytime an item is shown/changed */
				callback: function(){} /* Called when prettyPhoto is closed */});
	
	
	$("#provinciesmap area").bind('mouseenter',function(event) {
		var provincieobj = $('#provinciesnederland')[0];
		if (provincieobj != null && event.target.alt != undefined) {
			provincieobj.src = "/images/provincies-" + event.target.alt + '.png';
			provincieobj.alt =event.target.alt
		}
        return false;
    });
	
	if (document.getElementById('map') != null) {
		var map = new GMap2(document.getElementById('map'));
		var mapControl = new GMapTypeControl();
		map.addControl(mapControl);
		map.addControl(new GLargeMapControl());
		var mcenter = new GLatLng(53.2160482,5.6549926);
		map.setCenter(mcenter, 11);	
		
		var menaldum = new GLatLng(53.216048,5.654926);
		marker = new GMarker(menaldum);
		map.addOverlay(marker);
		marker.openInfoWindowHtml("<div class=\"contactmarker\"><strong>Norsk Trepleie Nederland ®</strong><br/>Ljochtmisdyk 44<br/>9036 VP Menaldum</div>");
	}
});

