// JavaScript Document
$(document).ready(function() {		
	/*
	var contentHeight = $(document).height()-$('#menuRow').height()-$('#mastHeadRow').height()-16;
	//alert(contentHeight);
	$('#mainContent').height(contentHeight);
	
	$(window).resize(function() {
		var contentHeight = $(document).height()-$('#menuRow').height()-$('#mastHeadRow').height()-16;
		$('#mainContent').height(contentHeight);
	});
	*/

	var	rate = 800,
		ticketsDisplayed = false,
		fadeOpacity = .3;
	
	
	$("#mcs_container").mCustomScrollbar("vertical",400,"easeOutCirc",1.05,"auto","yes","yes",10);
	$('.navMenuItem').stop().animate({opacity: 0},0);
	$('.activeArtistListImg').stop().animate({opacity: 0},0);
	$('#artistListImg1').stop().animate({opacity: 1},0);
	
	$('#ticketTab').click(
		function() {
			if(ticketsDisplayed==false){
				$('#tickets').stop().animate({top:'0px'},rate);
				$('#allContent').stop().animate({opacity: fadeOpacity},rate/1.5);
				$('#allContent').css('cursor','pointer');
				ticketsDisplayed = true;
			}
			else{
				$('#tickets').stop().animate({top:'-370px'},rate);
				$('#allContent').stop().animate({opacity: '1'},rate*1.5);
				$('#allContent').css('cursor','');
				ticketsDisplayed = false;
			}
		}		
	);
	$('#allContent').click(
		function() {
			if(ticketsDisplayed==false){
				//do nothing
			}
			else{
				$('#tickets').stop().animate({top:'-370px'},rate);
				$('#allContent').stop().animate({opacity: '1'},rate*1.5);
				$('#allContent').css('cursor','');
				ticketsDisplayed = false;
			}
		}
	);
	$('#allContent').hover(
		function(){
			if(ticketsDisplayed==false){
				//do nothing
			}
			else{
				$('#allContent').stop().animate({opacity: '.6'},rate/2);
			}	
		}, 
		function(){
			if(ticketsDisplayed==false){
				//do nothing
			}
			else{
				$('#allContent').stop().animate({opacity: fadeOpacity},rate/2);
			}	
		}
	);
	$('#dryAlert').jqm({
		modal: true,
		overlay: 80,
		ajax: 'wp-content/themes/photosynthesis2011/dryAlert.html',
		trigger: 'a.dryCall'
		}
	);
	
	
	
	var navFadeRate = 250;
	
	$('#navAbout').hover(
		function() {$(this).stop().animate({"opacity": "1"}, navFadeRate);},
		function() {$(this).stop().animate({"opacity": "0"}, navFadeRate);}
	);
	$('#navVenue').hover(
		function() {$(this).stop().animate({"opacity": "1"}, navFadeRate);},
		function() {$(this).stop().animate({"opacity": "0"}, navFadeRate);}
	);
	$('#navArtists').hover(
		function() {$(this).stop().animate({"opacity": "1"}, navFadeRate);},
		function() {$(this).stop().animate({"opacity": "0"}, navFadeRate);}
	);
	$('#navWorkshops').hover(
		function() {$(this).stop().animate({"opacity": "1"}, navFadeRate);},
		function() {$(this).stop().animate({"opacity": "0"}, navFadeRate);}
	);
	$('#navVendors').hover(
		function() {$(this).stop().animate({"opacity": "1"}, navFadeRate);},
		function() {$(this).stop().animate({"opacity": "0"}, navFadeRate);}
	);
	$('#navContact').hover(
		function() {$(this).stop().animate({"opacity": "1"}, navFadeRate);},
		function() {$(this).stop().animate({"opacity": "0"}, navFadeRate);}
	);
	$('#navTickets,#ticketTab').hover(
		function() {$('#navTickets').stop().animate({"opacity": "1"}, navFadeRate);},
		function() {$('#navTickets').stop().animate({"opacity": "0"}, navFadeRate);}
	);
	
	$('#audioArtistListTitle').click(function() {
		$('#audioArtistList').show(0);
		$('#multimediaArtistList').hide(0);
		$('#fineArtistList').hide(0);
		$('#dancerArtistList').hide(0);
		$('#artistListImg1').stop().animate({opacity: 1},0);
		$('#artistListImg2').stop().animate({opacity: 0},0);
		$('#artistListImg3').stop().animate({opacity: 0},0);
		$('#artistListImg4').stop().animate({opacity: 0},0);
	    return false;
	});
	$('#multimediaArtistListTitle').click(function() {
		$('#audioArtistList').hide(0);
		$('#multimediaArtistList').show(0);
		$('#fineArtistList').hide(0);
		$('#dancerArtistList').hide(0);
		$('#artistListImg1').stop().animate({opacity: 0},0);
		$('#artistListImg2').stop().animate({opacity: 1},0);
		$('#artistListImg3').stop().animate({opacity: 0},0);
		$('#artistListImg4').stop().animate({opacity: 0},0);
	    return false;
	});
	$('#fineArtistListTitle').click(function() {
		$('#audioArtistList').hide(0);
		$('#multimediaArtistList').hide(0);
		$('#fineArtistList').show(0);
		$('#dancerArtistList').hide(0);
		$('#artistListImg1').stop().animate({opacity: 0},0);
		$('#artistListImg2').stop().animate({opacity: 0},0);
		$('#artistListImg3').stop().animate({opacity: 1},0);
		$('#artistListImg4').stop().animate({opacity: 0},0);
	    return false;
	});
	$('#dancerArtistListTitle').click(function() {
		$('#audioArtistList').hide(0);
		$('#multimediaArtistList').hide(0);
		$('#fineArtistList').hide(0);
		$('#dancerArtistList').show(0);
		$('#artistListImg1').stop().animate({opacity: 0},0);
		$('#artistListImg2').stop().animate({opacity: 0},0);
		$('#artistListImg3').stop().animate({opacity: 0},0);
		$('#artistListImg4').stop().animate({opacity: 1},0);
	    return false;
	});
	
});		
