// JavaScript Document

jQuery(function() {
	
    $(document).ready(function() {
		
$("#n1 a").click(function(){
	$("#main").show();
	$("#speakers").hide();
	$("#club").hide();
	$("#special").hide();
	$("ul#schNav li a").removeClass("active");
	$(this).addClass("active");
});
		
$("#n2 a").click(function(){
	$("#main").hide();
	$("#speakers").hide();
	$("#club").hide();
	$("#special").show();
	$("ul#schNav li a").removeClass("active");
	$(this).addClass("active");
});

$("#n3 a").click(function(){
	$("#main").hide();
	$("#speakers").show();
	$("#club").hide();
	$("#special").hide();
	$("ul#schNav li a").removeClass("active");
	$(this).addClass("active");
});

$("#n4 a").click(function(){
	$("#main").hide();
	$("#speakers").hide();
	$("#club").show();
	$("#special").hide();
	$("ul#schNav li a").removeClass("active");
	$(this).addClass("active");
});
		
$("#tag, #nav, #dates, #footer, .logo, #content").css("visibility","hidden");
$(" #about, #home, #lineup, #tickets, #schedule, #partners, #info, #contact", "#footer").css("display", "none");			
	$(function() {
		
    $.preload([
        "images/logo.jpg",
		"images/bg_content.jpg",
		"images/bg_interior.jpg",
		"images/buy_tickets.png",
		"images/about_copy.png",
		"images/videos_up.png",
		"images/videos_over.png",
		"images/volunteer_up.png",
		"images/volunteer_over.png",
		"images/rates_up.png",
		"images/rates_over.png",
		"images/sponsors_up.png",
		"images/sponsors_over.png",
		"images/photos_up.png",
		"images/photos_over.png",
		"images/bg_dl_map_over2.png",
		"images/bg_directions_over.png",
		"images/buy_over.png",
		"images/bg_frame.jpg",
		"images/bg_frame_vert.jpg",
		"images/bg_artists.png"
		
		
    ], {
        init: function(loaded, total) {
        },
        loaded: function(img, loaded, total) {
			
        if(loaded==16){
					test();	

		}
        },
        loaded_all: function(loaded, total) {
		 
	
				

		  
		  
        }
		
    });
	
	 if ($.browser.msie) {
 //test();
  }
 


	function test(){
		              

		 if(window.location.hash!=""){
				linkLoc=window.location.hash;
if((linkLoc=="#home")||(linkLoc=="#schedule")){
					$('#content').removeClass('interior').addClass('home');
					


}else{
					$('#content').removeClass('home').addClass('interior');
						$("#nav "+linkLoc+"_nav").addClass("current");	
						


}
		
		
		}else{
			
		linkLoc ='#home';	
				$('#content').removeClass('interior').addClass('home');
				

				
		}
		
		
	 		$("#content, #footer").css("left","1988px");

									 $("#tag, #nav, #dates, #footer, .logo, #content").css("visibility","visible");
											 $("#nav, #dates, #footer, .logo, #content").fadeOut(0);


											 $("#tag, #nav, #dates,.logo, #content, #footer").fadeIn(900, "linear");
											 	
          	 $(".logo, #nav").animate({opacity: "1", 'filter': ''}, 400, 
						 
						 
                    function () {                      
		
	
		
				
		$(linkLoc).show();

										  
										  
										  $(".ticket").rotate({animateTo:2});
$('#tag').animate({
    left: ['851', 'swing']}, 100, 'swing', function() {
     		$('.scroll-pane').jScrollPane({showArrows: true, verticalDragMinHeight: 60,
			verticalDragMaxHeight: 60});					

  });
						 $("#content, #footer").animate({left: "0", top:"0"}, 250, 
                    function () { 
					
					
                                                                  										  $(".ticket").rotate({animateTo:0});

$('#tag').animate({
    left: ['853', 'swing']
  }, 100, 'swing', function() {
     
  });
                     	 $(" #dates").animate({opacity: "1", 'filter': ''}, 1000, 
                    function () { 

                    });
                    });
				
                    });
					
					
				
	};
	
	
	
	 $("#nav a, a.goHome, a.goTo, #tag a").click(function(event){
		 	  $("#nav a").removeClass("current");
		 
        event.preventDefault();
		window.location.hash = $(this).attr('href');
        linkLocation =   window.location.hash = this.hash;
        
        _gaq.push(['_trackPageview', window.location.hash]);

	
	$("#nav "+linkLocation+"_nav").addClass("current");	
$("#content").animate({left: "-=988px"}, 250, 
                    function () { 

                              $("#about, #home, #lineup, #tickets, #schedule, #partners, #info, #contact").css("display", "none");


        $(linkLocation).show();



					   $(linkLocation).animate({opacity:"1", 'filter': ''}, 0, 
                    function () { 
                                                                 

                     
                    });


$("#content").animate({left: "+=1976px"}, 0, 
                    function () { 
					
					
			
		if((linkLocation=="#home")||(linkLocation=="#schedule")){
		$('#content').removeClass('interior').addClass('home');
	
		}else{
				$('#content').removeClass('home').addClass('interior');
	
		}
                     $('#tag').animate({
    left: ['851', 'swing']
  }, 100, 'swing', function() {
     
  });
										  $(".ticket").rotate({animateTo:2});

					   $("#content").animate({left: "0", top:"0",opacity:"1", 'filter': ''}, 250, 
                    function () { 

					$('#tag').animate({
    left: ['853', 'swing']
  }, 100, 'swing', function() {
     
  });
										  $(".ticket").rotate({animateTo:0});
										  
										  if(linkLocation=="#lineup"){
$('.scroll-pane').jScrollPane({showArrows: true, verticalDragMinHeight: 60,
			verticalDragMaxHeight: 60});			}
                     
                    });
                    });	
					
					  
                    });		    });			
	

});

	
		
           
	});
		

	$(".bu_vid").hover(function() {
		$(this).attr("src","images/videos_over.png");
			}, function() {
		$(this).attr("src","images/videos_up.png");
	});
	
	$(".bu_vol").hover(function() {
		$(this).attr("src","images/volunteer_over_new.png");
			}, function() {
		$(this).attr("src","images/volunteer_up.png");
	});
	
	$(".bu_rates").hover(function() {
		$(this).attr("src","images/rates_over.png");
			}, function() {
		$(this).attr("src","images/rates_up.png");
	});
	
	$(".bu_sponsors").hover(function() {
		$(this).attr("src","images/sponsors_over.png");
			}, function() {
		$(this).attr("src","images/sponsors_up.png");
	});
	
	$(".bu_photos").hover(function() {
		$(this).attr("src","images/photos_over.png");
			}, function() {
		$(this).attr("src","images/photos_up.png");
	});
	
	
	
	$(".bu_special").hover(function() {
		$(this).attr("src","images/buy_over.png");
			}, function() {
		$(this).attr("src","images/buy.png");
	});
	
	
	$(".bu_poster").hover(function() {
		$(this).attr("src","images/dl_poster_over.png");
			}, function() {
		$(this).attr("src","images/dl_poster.png");
	});
	
	

$(".ticket").rotate({ 
   bind: 
     { 
	 
	 
        mouseover : function() { 
		
		$('#tag').animate({
    left: ['850', 'swing']
  }, 100, 'swing', function() {
     
  });
		
            $(this).rotate({animateTo:2})
        },
        mouseout : function() { 
		 $('#tag').animate({
    left: ['853', 'swing']
  }, 100, 'swing', function() {
     
  });
		
            $(this).rotate({animateTo:0})
        }
     } 
   
});
	
	
	

    });
	function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
