/**
 * @author LR
 */
$(document).ready(function(){
    var hashtom = location.hash;
    //menuSelect = $.bbq.getState();
    //alert(hash);
    
	jQuery.introAnimation = function() { 
   
   $('.contact').hover(function () { $(this).stop(true, true) });
   $('.retouch').hover(function () { $(this).stop(true, true) });
   $('.photography').hover(function () { $(this).stop(true, true) });
   
   $('#arrowfade').delay(1000).fadeTo(100, 1, function(){
            // Animation complete
        });
        $('#arrowretouch').delay(1000).fadeTo(300, 1, function(){
            // Animation complete
        });
        $('#retouch_m').delay(1000).fadeTo(250, 1, function(){
            /*
             $('#arrowfade').delay(400).fadeTo(100, 0, function(){
             // Animation complete
             });
             */
            $('#arrowretouch').delay(400).fadeTo(300, 0, function(){
                // Animation complete
            });
            
            $('#retouch_m').delay(400).fadeTo(250, 0, function(){
                ///// second:
                ///
                $('	#arrowfade').fadeTo(100, 1, function(){
                    // Animation complete
                });
                $('#arrowcontact').fadeTo(300, 1, function(){
                    // Animation complete
                });
                
                $('#contact_m').fadeTo(250, 1, function(){
                    /// contacts fade out
                    ///
                    /*
                     $('#arrowfade').delay(400).fadeTo(100, 0, function(){
                     // Animation complete
                     });
                     */
                    $('#arrowcontact').delay(400).fadeTo(300, 0, function(){
                        // Animation complete
                    });
                    
                    $('#contact_m').delay(400).fadeTo(250, 0, function(){
                        // Animation complete
                        /////
                        //
                        /*
                         $('#arrowfade').fadeTo(100, 1, function(){
                         // Animation complete
                         });
                         */
                        $('#arrowphotography').fadeTo(300, 1, function(){
                            // Animation complete
                        });
                        
                        $('#photography_m').fadeTo(250, 1, function(){
                            // Animation complete
                            //
                            $('#arrowfade').delay(400).fadeTo(100, 0, function(){
                                // Animation complete
                            });
                            $('#arrowphotography').delay(400).fadeTo(300, 0, function(){
                                // Animation complete
                            });
                            
                            $('#photography_m').delay(400).fadeTo(250, 0, function(){
                                // Animation complete
                            });
                        });
                    });
                });
                
                
                
            });
        });

};// afslutter introAnimation
	
	
	
    if (hashtom == "") {
        //alert("hash er tom");  
        // hvis det er første gang man kommer ind sættes menuen frem og animationen afspilles
		menu = {"LR": "Start" };
		jQuery.bbq.pushState( menu, 2 );
	
//	$('hoverElementsSelector').hover(function () { $('animationSelector').stop()
		
		// kalder min intro animation
		jQuery.introAnimation();
		
		/*
        $('#links').hover(function () { $.introAnimation().stop()
		
        });
        */
        
        
    };//afslutter if statement
    });
