		var isPlaying = true;
		var activeElement = false;
		
		var videopath = "";
		var swfplayer = videopath + "media/flowplayer-3.1.5.swf";
		var swfcontent = videopath + "media/flowplayer.content-3.1.0.swf";
		var swfcaptions = videopath + "media/flowplayer.captions-3.1.4.swf";

				
		//function to change pages with main navigation
		function changePage(newpage) {
			
			$('#bgs').cycle('pause');
			
			if(activeElement) 
			{
		   	 	$(activeElement).css('display','none');
		   	 	$(newpage).fadeIn('slow');
			} 
			else 
			{
				$(newpage).fadeIn('slow');
		   	}
		   	 activeElement = newpage;
	   	 	
		}
		
		function resetHome() {
			$(activeElement).fadeOut('slow', function() {
				activeElement = false;
				$('#bgs').cycle('resume');
			});
		}
		
		
		
		$(document).ready(function() {
			pageTracker._trackPageview('/navigation/'+ 'home');
		    var stack = []; 
		 
		    // preload images into an array; we will preload bg3.jpg - bg4.jpg 
		    for (var i = 3; i < 4; i++) { 
		        var img = new Image(200,200); 
		        img.src = 'images/backgrounds/bg' + i + '.jpg'; 
		        $(img).bind('load', function() { 
		            stack.push(this); 
		        }); 
		    }  
 
			 $('.pics, #bgs').cycle({
				fx: 'fade',
				speed:    2000, 
   				 timeout:  6000,
   				 before: onBefore 
			});
			
		    // add images to slideshow 
		    function onBefore(curr, next, opts) { 
		        if (opts.addSlide) // <-- important! 
		            while(stack.length) 
		                opts.addSlide(stack.pop());  
		    }; 
					
					
			
			
			
			
			
			
			
			
			

			$('a.home_link').click(function() {
				resetHome();
			})
			
			$('a#about_link').click(function() {
				pageTracker._trackPageview('/navigation/'+ 'about');
				changePage('div#about');
			})
			
			$('a#banquet_link').click(function() {
				pageTracker._trackPageview('/navigation/'+ 'banquet');
				changePage('div#banquet');
			})
			
			$('a#menu_link').click(function() {
				pageTracker._trackPageview('/navigation/'+ 'menu');
				changePage('div#menu');		
			})
			
			$('a#rental_link').click(function() {
				pageTracker._trackPageview('/navigation/'+ 'rental');
				changePage('div#rental');
			})
			
			$('a#gallery_link').click(function() {
				pageTracker._trackPageview('/navigation/'+ 'gallery');
				changePage('div#gallery');
			})
			
			$('a#testimonial_link').click(function() {
				pageTracker._trackPageview('/navigation/'+ 'testimonial');
				changePage('div#testimonial');
				$('.scroll-pane').jScrollPane();
			})
			
			$('a#contact_link').click(function() {
				pageTracker._trackPageview('/navigation/'+ 'contact');
				changePage('div#contact');
			})
			
			
			
			$("#jpId").jPlayer( {
			    ready: function () {
			      this.element.jPlayer("setFile", "media/pachelbel-canon-complete.mp3").jPlayer("play"); // Auto-Plays the file
			    },
			    swfPath: "media"
			  });
			  
			  
			  
			  //create gallery
				/* $("a.maingallery").fancybox({'overlayOpacity' : '.8'}); */
				// Load the classic theme
		    Galleria.loadTheme('js/galleria/themes/classic/galleria.classic.min.js');
		
		    // Initialize Galleria
		    $('#galleria').galleria({
		        flickr: 'set:72157628899485665',
		        flickrOptions: {
		            sort: 'date-posted-asc',
		            max: 100,
		            thumbsize: 'small'
		        }
		    });
						
				
				
				
			  //toggle mute
			  
			  $("div#footer a#sound").hover(
			  	function(){
			  		$("a#sound").css({"background-position":"0px -44px"});
			  	},
			  	function(){
			  		$(this).css({"background-position":"0px 0px"});
			  	}
			  );
			  
			  $("div#footer a#sound").toggle(function() {
			  		$("#jpId").jPlayer("pause");
			  		isPlaying = false;
			  		$(this).css({"background-position":"0px -89px"});
			  		$("div#footer a#sound").hover(
					  	function(){
					  		$("a#sound").css({"background-position":"0px -133px"});
					  	},
					  	function(){
					  		$(this).css({"background-position":"0px -89px"});
					  	}
					  );
			  	
			  	}, function(){
			  		$("#jpId").jPlayer("play");
			  		isPlaying = true;
			  		$(this).css({"background-position":"0px 0px"});
					  $("div#footer a#sound").hover(
					  	function(){
					  		$("a#sound").css({"background-position":"0px -44px"});
					  	},
					  	function(){
					  		$(this).css({"background-position":"0px 0px"});
					  	}
					  );
	
			  	
			  	
			  });
			  
					
			});


