$(document).ready(function() {
	

	
	centerAll();
	$("#msgEnterHolder").append(
	'<div id="msgEnter">'+
	'E N T R E R'+
	'</div>'
	);
	
	cssEnter={
		"position":"relative",
		"top":"385px",
		"left":"1000px",
		"font-family": "'Josefin Sans', serif",
		"background":"#fff",
		'padding':'7px 0px 0px 7px',
		'font-weight':'regular',
		'font-size':'16px',
		'width':'200px',
		'height':'30px',
		'display':'block',
		'opacity':0
	};
	
	$("#msgEnter").css(cssEnter);
	
	
	
	$(window).resize(function(){
		
		centerAll();
		
	});
	
	splashHome('yes');
	$.webStorage.session().setItem('anim', 'yes');
	
	// Caching the feedback object:
    var msgenter = $('#msgEnter');
	
	$(document).hover(function(){

        // We are storing the values of the animated
        // properties in a separate object:

        var anim    = {
            mlft : 1000,
			opa : 0
        };

        var el = $(this).find('#msgEnterHolder');

        if(el.hasClass('hide')){
            anim = {
                mlft : 800,
				opa : 1
            };
        }
		
		
        // The first animation moves the form up or down, and the second one
        // moves the "Feedback" heading, so it fits in the minimized version

        msgenter.stop().animate({left:anim.mlft,opacity:anim.opa},function(){
            el.toggleClass('hide show');
        });
	}).click(function(){
		// ------------------------------------------------------------------------------------------------------------------------------------------------------------------- url à modifier
		//location.href="/bonnie/?cat=1";
		location.href="http://www.bonniecolin.com/?cat=1";
	});
	 
});

function centerAll(){
	
	leftBlk=(($(window).width()-$("#splashHome").width())/2);
	topBlk=(($(window).height()-$("#splashHome").height())/2);
	
	
	
	$("#splashHome").css({
		'left':leftBlk+'px',
		'top':topBlk+'px'
	});
	$("#msgEnterHolder").css({
		'left':leftBlk+'px',
		'top':topBlk+'px'
	});
	
	
	
}
