document.domain = 'potmaat.nl';

$(function() {
	
	$("#main").msAccordion();



	$('#login').submit(function() {
		$.post('../PotmaatCMS.nl/public/login.php');
		return false;
	});

	$('#route .title').click(function() {
		window.location.hash='#route'
		load();
	});

	$('#fotoalbum .title:not(.loaded)').click(function(){
		$('#fotoalbum .content').load('fotoalbum.php');
 	});

	$('#downloads .title:not(.loaded)').click(function(){
		window.location.hash='#downloads'
		$('#downloads .content').load('downloads.php');
	});

	$('#producten .title:not(.loaded)').click(function(){
		window.location.hash='#producten'
		if($(this).hasClass('loaded')) return;
		$('#producten .content').load('producten.php');
		$(this).addClass('loaded');
	});

	$('#overpotmaat .title:not(.loaded)').click(function(){
		window.location.hash='#overpotmaat'
		if($(this).hasClass('loaded')) return;
		$('#overpotmaat .content').load('overpotmaat.php');
		$(this).addClass('loaded');
	});

	$('#inloggen .title').click(function(){
		$('#inloggen .content').load('inloggen.php');
	});

	$('#besteloverzicht .title').live('click',function(){
		$('#besteloverzicht .content').load('besteloverzicht.php');
	});

	$('.logo').live('click', function() {
		location.reload();
	});

	$('#eerste, #tweede, #derde, .welkom').show();

});

function login() {
	$('#inloggen .title').css("background-image", "url(./img/nav/besteloverzicht.png)")
	$('#inloggen .content h1').html('Besteloverzicht')
	$('#login').load("besteloverzicht.html")
}

function fotoalbum() {
	$('#fotoalbum .content')
	.hide()
	.load("fotoalbum.php")
	.show();
}
