var freeze = false;
var showing = "info";
var panelopen = false;
function click(artist) {
	if (artist != showing) {
		freeze = false;
		show(artist);	
	}
	freeze = true;
	$.scrollTo( 0, 800, {queue:true} );
	setTimeout ('unfreeze()',5000);
}
function unfreeze() {
	freeze = false;	
}
function show(artist) {
	if (!freeze) {
		showing = artist;
		//image
		$('#qr').html('<img src="images/lineup/' + artist + '.png" alt="" width="115" height="115" class="lineup" border="0">');
		$('#qr').hide();
		$('#qrbox').fadeIn(600);
		$('#qr').fadeIn(600);
	
		//info
		$('#pluto #info #content').html('<div class="artistinfo">' + artistInfo[artist] + "</div>");
		$('#pluto #info #content').hide();
		$('#pluto #info #content').fadeIn(400);
		//alert(artist);
	}
}
function hide() {
	//$('#qr').fadeOut(100);	
	//$('#pluto #info #content').html('<img src="images/plutoinfo.png" width="371" height="315" border="0" alt="">');
	//$('#pluto #info #content').hide();
	//$('#pluto #info #content').fadeIn('fast');
}
function inforeset() {
	if (!freeze) {
		$('#qrbox').fadeOut(400);
		$('#qr').fadeOut(400);	
		$('#pluto #info #content').html('<img src="images/plutoinfo.png" width="371" height="315" border="0" alt="">');
		$('#pluto #info #content').hide();
		$('#pluto #info #content').fadeIn('fast');
	}
}
function openclose() {
	if (panelopen) {
		panelopen = false;
		$("#panel").animate({
			left: "-435"
		}, 300 );
		$('#info_'+active).fadeOut(300);
		$('#openclose .text').text("open");
		
	} else {
		panelopen = true;
		$("#panel").animate({
			left: "0"
		}, 300 );
		showinfo(active);
		$('#openclose .text').text("close");
	}
}
var active = "nieuws";
function showinfo(menu) {
	if (menu == 'nieuws') {
		$('#infocontent').hide();
	} else {
		$('#infocontent').show();
	}
	if (menu == 'praktisch') {
		setTimeout ('initialize()',700);
	} else {
		$('#map_canvas').hide();
	}
	$('#info_'+active).hide();
	$('#menu #menu_'+active).removeClass('active');
	
	$('#info_'+menu).fadeIn(600);
	$('#menu #menu_'+menu).addClass('active');
	active = menu;
}
var map=null;
var geocoder = null;
var marker = null;
function initialize() {
	$('#map_canvas').show();
	var myOptions = {zoom:10,mapTypeId:google.maps.MapTypeId.ROADMAP}
	map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
	var center = new google.maps.LatLng(50.967346326,4.1865956783);
	map.setCenter(center);
	marker = new google.maps.Marker({map:map,position:center,draggable:false});
	$('#map_canvas').css('z-index','2');
}
$(document).ready(function() {
	$('#infocontent').hide();
	setTimeout ('openclose()',400);
	//site reposition?
	screenwidth = $(window).width();
	
	if (screenwidth < 1300) {
		marginleft = screenwidth - 860 - 1;
		$('#site').css("margin-left",marginleft);		
	} else {
		marginleft = 500;
		$('#site').css("margin-left",marginleft);		
	}
	
});




