/**
 * @author LR
 */
$(document).ready(function(){
				
				// smider en menu hash til start for at man skal kunne gå hele vejen tilbage med backspace
				
				menu = {"LR": "Start" };
				photography = {"LR": "Photography"};
				contact = {"LR": "Contact"};
				
				blog = {"LR": "Blog"};
				bio = {"LR": "Bio"};
				links = {"LR": "Links"};
				news = {"LR": "News"};
				projects = {"LR": "Projects"};
				web = {"LR": "Web"};
				
				retouch = {"LR": "Retouch"};
				design = {"LR": "Design"};
				
				
			
				
				/*
				var position = jQuery('#bg').offset();
				alert(position.left);
				alert(position.top);
				*/
				
				
				// fungerende eksempel
				// bbq test igen:
				/*
				 $(".hejlink").click(function(){
	                    state = { 
	 				 		 "key": "value", 
					 		 "key 2": [ 
						    "array252", 
						    "of", 
						    "items" 
							  ]  
							}
					$.bbq.pushState( state, 0 );
               	});
				
				$(".hejlink2").click(function(){
                 	
					url = $.bbq.getState('key 2');
					alert(url);
                });
				*/
				
				
				
				
				$(window).bind( 'hashchange', function(e) {
  					
					menuSelect = $.bbq.getState('LR');
					// alert(menuSelect);
					
					
					// var hash = location.hash;
					
					if (menuSelect == 'Start') {
						
						
						$("#biocontent").animate({
							"left": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#blogcontent").animate({
							"right": "0px",
							"top": "-1600px"
						}, 0);
						$("#contactcontent").animate({
							"right": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#designcontent").animate({
							"right": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#linkscontent").animate({
							"right": "+2560px",
							"top": "+1600px"
						}, 0);
						$("#newscontent").animate({
							"left": "0px",
							"top": "+1600px"
						}, 0);
						$("#photographycontent").animate({
							"left": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#projectscontent").animate({
							"left": "+2560px",
							"top": "0px"
						}, 0);
						$("#retouchcontent").animate({
							"right": "+2560px",
							"top": "+1600px"
						}, 0);
						$("#webcontent").animate({
							"left": "+2560px",
							"top": "+1600px"
						}, 0);
						
						$("#bg").animate({
							"left": "0px",
							"top": "0px"
						}, 0);
					};
					
					if (menuSelect == 'Bio') {
						
						$("#biocontent").animate({
							"left": "0px",
							"top": "0px"
						}, 0);
						$("#blogcontent").animate({
							"right": "0px",
							"top": "-1600px"
						}, 0);
						$("#contactcontent").animate({
							"right": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#designcontent").animate({
							"right": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#linkscontent").animate({
							"right": "+2560px",
							"top": "+1600px"
						}, 0);
						$("#newscontent").animate({
							"left": "0px",
							"top": "+1600px"
						}, 0);
						$("#photographycontent").animate({
							"left": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#projectscontent").animate({
							"left": "+2560px",
							"top": "0px"
						}, 0);
						$("#retouchcontent").animate({
							"right": "+2560px",
							"top": "+1600px"
						}, 0);
						$("#webcontent").animate({
							"left": "+2560px",
							"top": "+1600px"
						}, 0);
						
						$("#bg").animate({
							"left": "-2560px",
							"top": "+1600px"
						}, 0);
					};
					
					if (menuSelect == 'Blog') {
						
						$("#biocontent").animate({
							"left": "+1600px",
							"top": "-1600px"
						}, 0);
						$("#blogcontent").animate({
							"right": "0px",
							"top": "0px"
						}, 0);
						$("#contactcontent").animate({
							"right": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#designcontent").animate({
							"right": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#linkscontent").animate({
							"right": "+2560px",
							"top": "+1600px"
						}, 0);
						$("#newscontent").animate({
							"left": "0px",
							"top": "+1600px"
						}, 0);
						$("#photographycontent").animate({
							"left": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#projectscontent").animate({
							"left": "+2560px",
							"top": "0px"
						}, 0);
						$("#retouchcontent").animate({
							"right": "+2560px",
							"top": "+1600px"
						}, 0);
						$("#webcontent").animate({
							"left": "+2560px",
							"top": "+1600px"
						}, 0);
						
						$("#bg").animate({
							"left": "0px",
							"top": "+1600px"
						}, 0);
					};
					
					if (menuSelect == 'Contact') {
						
						
						$("#biocontent").animate({
							"left": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#blogcontent").animate({
							"right": "0px",
							"top": "-1600px"
						}, 0);
						$("#contactcontent").animate({
							"right": "0px",
							"top": "0px"
						}, 0);
						$("#designcontent").animate({
							"right": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#linkscontent").animate({
							"right": "+2560px",
							"top": "+1600px"
						}, 0);
						$("#newscontent").animate({
							"left": "0px",
							"top": "+1600px"
						}, 0);
						$("#photographycontent").animate({
							"left": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#projectscontent").animate({
							"left": "+2560px",
							"top": "0px"
						}, 0);
						$("#retouchcontent").animate({
							"right": "+2560px",
							"top": "+1600px"
						}, 0);
						$("#webcontent").animate({
							"left": "+2560px",
							"top": "+1600px"
						}, 0);
						
						$("#bg").animate({
							"left": "+2560px",
							"top": "+1600px"
						}, 0);
					};
					
					if (menuSelect == 'Design') {
						
						
						$("#biocontent").animate({
							"left": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#blogcontent").animate({
							"right": "0px",
							"top": "-1600px"
						}, 0);
						$("#contactcontent").animate({
							"right": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#designcontent").animate({
							"right": "0px",
							"top": "0px"
						}, 0);
						$("#linkscontent").animate({
							"right": "+2560px",
							"top": "+1600px"
						}, 0);
						$("#newscontent").animate({
							"left": "0px",
							"top": "+1600px"
						}, 0);
						$("#photographycontent").animate({
							"left": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#projectscontent").animate({
							"left": "+2560px",
							"top": "0px"
						}, 0);
						$("#retouchcontent").animate({
							"right": "+2560px",
							"top": "+1600px"
						}, 0);
						$("#webcontent").animate({
							"left": "+2560px",
							"top": "+1600px"
						}, 0);
						
						$("#bg").animate({
							"left": "+2560px",
							"top": "+1600px"
						}, 0);
					};
					
					if (menuSelect == 'Links') {
						
						
						$("#biocontent").animate({
							"left": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#blogcontent").animate({
							"right": "0px",
							"top": "-1600px"
						}, 0);
						$("#contactcontent").animate({
							"right": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#designcontent").animate({
							"right": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#linkscontent").animate({
							"right": "0px",
							"top": "0px"
						}, 0);
						$("#newscontent").animate({
							"left": "0px",
							"top": "+1600px"
						}, 0);
						$("#photographycontent").animate({
							"left": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#projectscontent").animate({
							"left": "+2560px",
							"top": "0px"
						}, 0);
						$("#retouchcontent").animate({
							"right": "+2560px",
							"top": "+1600px"
						}, 0);
						$("#webcontent").animate({
							"left": "+2560px",
							"top": "+1600px"
						}, 0);
						
						$("#bg").animate({
							"left": "+2560px",
							"top": "-1600px"
						}, 0);
					};
					
					if (menuSelect == 'News') {
						
						
						$("#biocontent").animate({
							"left": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#blogcontent").animate({
							"right": "0px",
							"top": "-1600px"
						}, 0);
						$("#contactcontent").animate({
							"right": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#designcontent").animate({
							"right": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#linkscontent").animate({
							"right": "+2560px",
							"top": "+1600px"
						}, 0);
						$("#newscontent").animate({
							"left": "0px",
							"top": "0px"
						}, 0);
						$("#photographycontent").animate({
							"left": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#projectscontent").animate({
							"left": "+2560px",
							"top": "0px"
						}, 0);
						$("#retouchcontent").animate({
							"right": "+2560px",
							"top": "+1600px"
						}, 0);
						$("#webcontent").animate({
							"left": "+2560px",
							"top": "+1600px"
						}, 0);
						
						$("#bg").animate({
							"left": "0px",
							"top": "-1600px"
						}, 0);
					};
					
					if (menuSelect == 'Photography') {
						
						
						$("#biocontent").animate({
							"left": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#blogcontent").animate({
							"right": "0px",
							"top": "-1600px"
						}, 0);
						$("#contactcontent").animate({
							"right": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#designcontent").animate({
							"right": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#linkscontent").animate({
							"right": "+2560px",
							"top": "+1600px"
						}, 0);
						$("#newscontent").animate({
							"left": "0px",
							"top": "+1600px"
						}, 0);
						$("#photographycontent").animate({
							"left": "0px",
							"top": "0px"
						}, 0);
						$("#projectscontent").animate({
							"left": "+2560px",
							"top": "0px"
						}, 0);
						$("#retouchcontent").animate({
							"right": "+2560px",
							"top": "+1600px"
						}, 0);
						$("#webcontent").animate({
							"left": "+2560px",
							"top": "+1600px"
						}, 0);
						
						$("#bg").animate({
							"left": "-2560px",
							"top": "+1600px"
						}, 0);
				
				$(".photographyback").click(function(){
					
					
                    $("#photographycontent").animate({
                        "left": "+=2560px",
                        "top": "-=1600px"
                    }, 2000);
					
                    $("#bg").animate({
                        "left": "0px", 
                        "top": "0px" 
                    }, 2000,
					function(){ jQuery.bbq.pushState( menu, 2 ); }
					);
					
                });
						
						
					};
						
					
					if (menuSelect == 'Projects') {
						
						
						$("#biocontent").animate({
							"left": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#blogcontent").animate({
							"right": "0px",
							"top": "-1600px"
						}, 0);
						$("#contactcontent").animate({
							"right": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#designcontent").animate({
							"right": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#linkscontent").animate({
							"right": "+2560px",
							"top": "+1600px"
						}, 0);
						$("#newscontent").animate({
							"left": "0px",
							"top": "+1600px"
						}, 0);
						$("#photographycontent").animate({
							"left": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#projectscontent").animate({
							"left": "0px",
							"top": "0px"
						}, 0);
						$("#retouchcontent").animate({
							"right": "+2560px",
							"top": "+1600px"
						}, 0);
						$("#webcontent").animate({
							"left": "+2560px",
							"top": "+1600px"
						}, 0);
						
						$("#bg").animate({
							"left": "-2560px",
							"top": "0px"
						}, 0);
					};
					
					if (menuSelect == 'Retouch') {
						
						
						$("#biocontent").animate({
							"left": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#blogcontent").animate({
							"right": "0px",
							"top": "-1600px"
						}, 0);
						$("#contactcontent").animate({
							"right": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#designcontent").animate({
							"right": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#linkscontent").animate({
							"right": "+2560px",
							"top": "+1600px"
						}, 0);
						$("#newscontent").animate({
							"left": "0px",
							"top": "+1600px"
						}, 0);
						$("#photographycontent").animate({
							"left": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#projectscontent").animate({
							"left": "+2560px",
							"top": "0px"
						}, 0);
						$("#retouchcontent").animate({
							"right": "0px",
							"top": "0px"
						}, 0);
						$("#webcontent").animate({
							"left": "+2560px",
							"top": "+1600px"
						}, 0);
						
						$("#bg").animate({
							"left": "+2560px",
							"top": "-1600px"
						}, 0);
					};
					
					if (menuSelect == 'Web') {
						
						
						$("#biocontent").animate({
							"left": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#blogcontent").animate({
							"right": "0px",
							"top": "-1600px"
						}, 0);
						$("#contactcontent").animate({
							"right": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#designcontent").animate({
							"right": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#linkscontent").animate({
							"right": "+2560px",
							"top": "+1600px"
						}, 0);
						$("#newscontent").animate({
							"left": "0px",
							"top": "+1600px"
						}, 0);
						$("#photographycontent").animate({
							"left": "+2560px",
							"top": "-1600px"
						}, 0);
						$("#projectscontent").animate({
							"left": "+2560px",
							"top": "0px"
						}, 0);
						$("#retouchcontent").animate({
							"right": "+2560px",
							"top": "+1600px"
						}, 0);
						$("#webcontent").animate({
							"left": "0px",
							"top": "0px"
						}, 0);
						
						$("#bg").animate({
							"left": "-2560px",
							"top": "-1600px"
						}, 0);
					};
					
					
					
					
					/* 
					 // kan være link-punktet tilbage til menuen skal være blankt med return false eller lign
					if (hash == '#menu') {
						jQuery.bbq.removeState();
						window.location.reload( true );
						
					}
					*/
					
				});
				$(window).trigger( 'hashchange' );
				
					
					
				
					
				/**
				 * Animate effect on menu click
				 */
				// on click animation to content
				// I assume its here I need to add the bbq script
				//
               
			   
			    $(".photography").click(function(){
                    
					$("#bg").animate({
                        "left": "-=2560px",
                        "top": "+=1600px"
                    }, 2000);
                    $("#photographycontent").animate({
                        "left": "0px",
                        "top": "0px"
                    }, 2000,
					function(){ 
						jQuery.bbq.pushState( photography, 2 );
						
						 
 
 

					 }
					);
					 
					//jQuery.bbq.pushState( menu, 2 );
					
                });
				
				
				
				
				
				$(".bio").click(function(){
                    $("#bg").animate({
                        "left": "-=2560px",
                        "top": "+=1600px"
                    }, 2000,
					function(){ jQuery.bbq.pushState( bio, 2 ); }
					);
                    $("#biocontent").animate({
                        "left": "0px",
                        "top": "0px"
                    }, 2000);
                });
				
				$(".bioback").click(function(){
                    $("#biocontent").animate({
                        "left": "+=2560px",
                        "top": "-=1600px"
                    }, 2000,
					function(){ jQuery.bbq.pushState( menu, 2 ); }
					);
					
                    $("#bg").animate({
                        "left": "+=2560px",
                        "top": "-=1600px"
                    }, 2000);
                });

				// Design:
                $(".design").click(function(){
                    $("#bg").animate({
                        "left": "+=2560px",
                        "top": "+=1600px"
                    }, 2000,
					function(){ jQuery.bbq.pushState( design, 2 ); }
					);
                    $("#designcontent").animate({
                        "right": "0px",
                        "top": "0px"
                    }, 2000);
                });
				
				$(".designback").click(function(){
                    $("#designcontent").animate({
                        "right": "+=2560px",
                        "top": "-=1600px"
                    }, 2000,
					function(){ jQuery.bbq.pushState( design, 2 ); }
					);
					
                    $("#bg").animate({
                        "left": "-=2560px",
                        "top": "-=1600px"
                    }, 2000);
                });
				
				// Contact:
                $(".contact").click(function(){
                    $("#bg").animate({
                        "left": "+=2560px",
                        "top": "+=1600px"
                    }, 2000);
					
                    $("#contactcontent").animate({
                        "right": "0px",
                        "top": "0px"
                    }, 2000,
					function(){ jQuery.bbq.pushState( contact, 2 ); }
					);
                });
				
				$(".contactback").click(function(){
                    $("#contactcontent").animate({
                        "right": "+=2560px",
                        "top": "-=1600px"
                    }, 2000,
					function(){ jQuery.bbq.pushState( menu, 2 ); }
					);
					
                    $("#bg").animate({
                        "left": "-=2560px",
                        "top": "-=1600px"
                    }, 2000);
                });

				
				// Retouch:
                $(".retouch").click(function(){
                    $("#bg").animate({
                        "left": "+=2560px",
                        "top": "-=1600px"
                    }, 2000);
                    $("#retouchcontent").animate({
                        "right": "0px",
                        "top": "0px"
                    }, 2000,
					function(){ jQuery.bbq.pushState( retouch, 2 ); }
					);
                });
				
				$(".retouchback").click(function(){
                    $("#retouchcontent").animate({
                        "right": "+=2560px",
                        "top": "+=1600px"
                    }, 2000,
					function(){ jQuery.bbq.pushState( menu, 2 ); }
					);
					
                    $("#bg").animate({
                        "left": "-=2560px",
                        "top": "+=1600px"
                    }, 2000);
                });
				
				// links:
                $(".links").click(function(){
                    $("#bg").animate({
                        "left": "+=2560px",
                        "top": "-=1600px"
                    }, 2000,
					function(){ jQuery.bbq.pushState( links, 2 ); }
					);
                    $("#linkscontent").animate({
                        "right": "0px",
                        "top": "0px"
                    }, 2000);
                });
				
				$(".linksback").click(function(){
                    $("#linkscontent").animate({
                        "right": "+=2560px",
                        "top": "+=1600px"
                    }, 2000,
					function(){ jQuery.bbq.pushState( menu, 2 ); }
					);
					
                    $("#bg").animate({
                        "left": "-=2560px",
                        "top": "+=1600px"
                    }, 2000);
                });


				// Web:
                $(".web").click(function(){
                    $("#bg").animate({
                        "left": "-=2560px",
                        "top": "-=1600px"
                    }, 2000,
					function(){ jQuery.bbq.pushState( web, 2 ); }
					);
                    $("#webcontent").animate({
                        "left": "0px",
                        "top": "0px"
                    }, 2000);
                });
				
				$(".webback").click(function(){
                    $("#webcontent").animate({
                        "left": "+=2560px",
                        "top": "+=1600px"
                    }, 2000,
					function(){ jQuery.bbq.pushState( menu, 2 ); }
					);
					
                    $("#bg").animate({
                        "left": "+=2560px",
                        "top": "+=1600px"
                    }, 2000);
                });
				
				// News:
                $(".news").click(function(){
                    $("#bg").animate({
                        "top": "-=1600px",
						"left": "0px"
                    }, 2000,
					function(){ jQuery.bbq.pushState( news, 2 ); }
					);
                    $("#newscontent").animate({
                        "top": "-=1600px"
                    }, 2000);
                });
				
				$(".newsback").click(function(){
                    $("#newscontent").animate({
                        "top": "+=1600px"
                    }, 2000,
					function(){ jQuery.bbq.pushState( menu, 2 ); }
					);
					
                    $("#bg").animate({
                        "top": "+=1600px"
                    }, 2000);
                });
				
				// Blog:
                $(".blog").click(function(){
                    $("#bg").animate({
                        "top": "+=1600px",
						"left": "0px"
                    }, 2000,
					function(){ jQuery.bbq.pushState( blog, 2 ); }
					);
                    $("#blogcontent").animate({
                        "top": "+=1600px"
                    }, 2000);
                });
				
				$(".blogback").click(function(){
                    $("#blogcontent").animate({
                        "top": "-=1600px"
                    }, 2000,
					function(){ jQuery.bbq.pushState( menu, 2 ); }
					);
					
                    $("#bg").animate({                        
                        "top": "-=1600px"
                    }, 2000);
                });
				
				// Projects:
                $(".projects").click(function(){
                    $("#bg").animate({
                        "left": "-=2560px",
						"top": "0px"
                    }, 2000,
					function(){ jQuery.bbq.pushState( projects, 2 ); }
					);
                    $("#projectscontent").animate({
                        "left": "-=2560px"
                    }, 2000);
                });
				
				$(".projectsback").click(function(){
                    $("#projectscontent").animate({
                        "left": "+=2560px"
                    }, 2000,
					function(){ jQuery.bbq.pushState( menu, 2 ); }
					);
					
                    $("#bg").animate({                        
                        "left": "+=2560px"
                    }, 2000);
                });

				

                
            });