$(document).ready(function(){
	
	/* BEGIN CUFON */
	Cufon.replace('#nav, #header.category h1, .cufon', { fontFamily: 'Helv', hover: true });
	Cufon.replace('#slider .block, #mosaic .hover, #shuffle .hover', { fontFamily: 'Helv', hover: true, textShadow: 'rgba(0,0,0,0.26) -1px -1px' });
	/* END CUFON */
	
	
	/* BEGIN STYLE */
	
	// Cookie
	if($.cookie('style') == 'blue') { $('.body').attr('id', 'blue'); }
	if($.cookie('style') == 'classic') { $('.body').attr('id', 'classic'); }
	if($.cookie('style') == 'clean') { $('.body').attr('id', 'clean'); }
	if($.cookie('style') == 'retro') { $('.body').attr('id', 'retro'); }
	if($.cookie('style') == 'clouds') { $('.body').attr('id', 'clouds'); }
	if($.cookie('style') == 'redish') { $('.body').attr('id', 'redish'); }
	if($.cookie('style') == 'celebration') { $('.body').attr('id', 'celebration'); }
	
	// Style
	$("#switch_1").click(function(){
		$('.body').attr('id', 'blue');
		$.cookie('style', 'blue', { expires: 365, path: '/', domain: 'versheid.com' });
	});
	$("#switch_2").click(function(){
		$('.body').attr('id', 'classic');
		$.cookie('style', 'classic', { expires: 365, path: '/', domain: 'versheid.com' });
	});
	$("#switch_3").click(function(){
		$('.body').attr('id', 'clean');
		$.cookie('style', 'clean', { expires: 365, path: '/', domain: 'versheid.com' });
	});
	$("#switch_4").click(function(){
		$('.body').attr('id', 'retro');
		$.cookie('style', 'retro', { expires: 365, path: '/', domain: 'versheid.com' });
	});
	$("#switch_5").click(function(){
		$('.body').attr('id', 'clouds');
		$.cookie('style', 'clouds', { expires: 365, path: '/', domain: 'versheid.com' });
	});
	$("#switch_6").click(function(){
		$('.body').attr('id', 'redish');
		$.cookie('style', 'redish', { expires: 365, path: '/', domain: 'versheid.com' });
	});
	$("#switch_7").click(function(){
		$('.body').attr('id', 'celebration');
		$.cookie('style', 'celebration', { expires: 365, path: '/', domain: 'versheid.com' });
	});
	/* END STYLE */
	
	
	/* BEGIN TOP */
	$("#top").hover(function () {
		$('> .ingelogd', this).animate( { opacity: 1.0 } , 100 );
		$('> .ingelogd', this).animate( { filter: 'alpha(opacity=100)' } , 100 );
	});
	$("#top").mouseleave(function () {
		$('> .ingelogd', this).animate( { opacity: 0 } , 100 );
		$('> .ingelogd', this).animate( { filter: 'alpha(opacity=0)' } , 100 );
	});
	/* END TOP */
	
	
	/* BEGIN HEAD */
	$("#slider").easySlider({
		auto: true, 
		speed: 1000,
		pause: 3800,
		continuous: true,
		numeric: true
	});
	
	// Cookie
	if($.cookie('slider') == 'mosaic') {
		$('#slider, #controls').hide();
		$('#mosaic').show();
	}
	
	// Header
	$('#mosaic-toggle').click(function(){
		$('#mosaic').hide();
		$('#slider, #controls').fadeIn();
		$.cookie('slider', 'slider', { expires: 365, path: '/', domain: 'versheid.com' });
	});
	$('#slider-toggle').click(function(){
		$('#slider, #controls').hide();
		$('#mosaic').fadeIn();
		$.cookie('slider', 'mosaic', { expires: 365, path: '/', domain: 'versheid.com' });
	});
        
	// Slider                
    $("#slider").hover(function () {
        $(this).find('.block').animate( { top: '220px' } , 125 );
    });
    
    $("#slider").mouseleave(function () {
        $(this).find('.block').animate( { top: '320px' } , 125 );
    });
	
	// Mosaic
	$("#mosaic .tile").hover(function () {
    	$('> .hover', this).fadeIn(200);
    });
    $("#mosaic .tile").mouseleave(function () {
        $('> .hover', this).fadeOut(200);
    });              
	/* END HEAD */
	
	
	/* BEGIN CONTENT */
	// Cookie
	if($.cookie('content') == 'blocks') {
		$('#items.toggleable, #items-toggle').hide();
		$('#blocks, #blocks-toggle').show();
	}
	
	// Toggle
	$('#items-toggle').click(function(){
		$('#items.toggleable, #items-toggle').hide();
		$('#blocks, #blocks-toggle').fadeIn();
		$.cookie('content', 'blocks', { expires: 365, path: '/', domain: 'versheid.com' });
	});
	$('#blocks-toggle').click(function(){
		$('#blocks, #blocks-toggle').hide();
		$('#items.toggleable, #items-toggle').fadeIn();
		$.cookie('content', 'items', { expires: 365, path: '/', domain: 'versheid.com' });
	});
	
	// Item
	/*
	$("#overzicht .item .image").hover(function () {
		$('> a img', this).animate( { opacity: 0.2 } , 200 );
		$('> a img', this).animate( { filter: 'alpha(opacity=20)' } , 200 );
	});
	$("#overzicht .item .image").mouseleave(function () {
		$('> a img', this).animate( { opacity: 1.0 } , 200 );
		$('> a img', this).animate( { filter: 'alpha(opacity=100)' } , 200 );
	});
	*/
	
	// Block
	$("#overzicht .block").live('hover', function () {
		$('> .hover', this).fadeIn(200);
	});
	$("#overzicht .block").live('mouseleave', function () {
		$('> .hover', this).fadeOut(200);
	});
	
	// Info
	$("#feature, #artikel").hover(function () {
		$('> .info', this).animate( { opacity: 1.0 } , 100 );
		$('> .info', this).animate( { filter: 'alpha(opacity=100)' } , 100 );
	});
	$("#feature, #artikel").mouseleave(function () {
		$('> .info', this).animate( { opacity: 0.5 } , 100 );
		$('> .info', this).animate( { filter: 'alpha(opacity=50)' } , 100 );
	});
	
	// Cycle
	$('#over-versheid-cycle').cycle();
	$('#shop-shirts').cycle({ timeout: 750 });
	
	// Shuffle
	$("#shuffle .tile").hover(function () {
    	$('> .hover', this).fadeIn(200);
    });
    $("#shuffle .tile").mouseleave(function () {
        $('> .hover', this).fadeOut(200);
    });
	/* END CONTENT*/
	
	
	/* BEGIN FOOTER */
	$("#switch_1").simpletip( { content: 'Feeling Blue', fixed: true, position: 'bottom' } );
	$("#switch_2").simpletip( { content: 'Classic', fixed: true, position: 'bottom' } );
	$("#switch_3").simpletip( { content: 'Clean', fixed: true, position: 'bottom' } );
	$("#switch_4").simpletip( { content: 'Retro 70s', fixed: true, position: 'bottom' } );
	$("#switch_5").simpletip( { content: 'Hercules Clouds', fixed: true, position: 'bottom' } );
	$("#switch_6").simpletip( { content: 'Redish', fixed: true, position: 'bottom' } );
	$("#switch_7").simpletip( { content: 'Celebrati&oacute;n', fixed: true, position: 'bottom' } );
	/* END FOOTER */
			
	/* BEGIN STICKYPOST */

	// item
	var stickyPostItem = $('#overzicht #items .item.sticky');
	$('#overzicht #items .item.sticky').remove();
	$('#overzicht #items .item:first-child').after(stickyPostItem);
	
	// block	
	var stickyPostBlock = $('#overzicht #blocks .block.sticky');
	$('#overzicht #blocks .block.sticky').remove();
	$('#overzicht #blocks .block:first-child').after(stickyPostBlock);
	
	/* END STICKYPOST */
		
});
