$(document).ready(function(){

//	jScrollPane Initiation
	$('.scroll').jScrollPane({
			verticalDragMaxHeight: 14,
			verticalDragMinHeight: 14,
			verticalGutter: 10,
	});
// END jScrollPane Initiation $('.scroll').jScrollPane


function formatTitle(title, currentArray, currentIndex, currentOpts) {
    return '<div id="fb-titleformat">'
    			+ (title && title.length ? title + '<br />' : '' )
    			+ '</div>' 
    			+ '<div id="countr">' 
    			+ 'Press ' 
    			+ (currentIndex + 1) + ' of ' + currentArray.length 
    			+ '</div>';
	}
	
	$('div#Abt div#News-Abt div.jspContainer div.jspPane p a.press').fancybox({
			'titlePosition'		: 'outside',
			'overlayColor'		: '#000',
			'overlayOpacity'	: 0.9,
			'titleFormat'		: formatTitle,
			'showCloseButton'	: false,
			'cyclic'			: true,
			'centerOnScroll'	: true,
			'onComplete'		: function(){
			
										$('#fancybox-overlay').click(function(){
	
											$('div#Info').animate({opacity: 0}, 200).remove();
											
											$('#fancybox-outer').removeClass('prs');
											
											$('a.nav-selec').unwrap();
		
										});
										
										$('div#Info').hover(function(){
	
											$(this).stop(true).animate({opacity: 1}, 700);
											},
											function(){
											$(this).stop(true, true).delay(1000).animate({opacity: .1}, 700);
											}
										
										);
																		
			},

										
	});
	
	$('div#Abt div#News-Abt div.jspContainer div.jspPane p a.inlinepress').fancybox({
			'titlePosition'		: 'outside',
			'width'				: 700,
			'height'			: 450,
			'overlayColor'		: '#000',
			'overlayOpacity'	: 0.9,
			'titleFormat'		: formatTitle,
			'showCloseButton'	: false,
			'cyclic'			: true,
			'centerOnScroll'	: true,
			'type'				: 'iframe',
			'onComplete'		: function(){
			
										$('#fancybox-overlay').click(function(){
	
											$('div#Info').animate({opacity: 0}, 200).remove();
											
											$('#fancybox-outer').removeClass('prs');
											
											$('a.nav-selec').unwrap();
		
										});
										
										$('div#Info').hover(function(){
	
											$(this).stop(true).animate({opacity: 1}, 500);
											},
											function(){
											$(this).stop(true, true).delay(1000).animate({opacity: .1}, 500);
											}
	
										);
										
																			
										
			},
			
										
	});
	
	$('div#Abt div#News-Abt div.jspContainer div.jspPane p a.press, div#Abt div#News-Abt div.jspContainer div.jspPane p a.inlinepress').click(function(){
	
		$('#fancybox-outer').addClass('prs');
	
		$('.prs a#fancybox-left, .prs a#fancybox-right').addClass('nav-selec');
	
		$('.prs a#fancybox-left, .prs a#fancybox-right').wrapAll('<div id="fb-nav" />');
	
		$('#fancybox-wrap').append('<div id="Info"><p>Click on the left and right buttons above title to flip through the gallery.<br /> <br />Click outside <br />the image to close.</p></div>');
									
		$('div#Info').animate({opacity: 1}, 800, function(){
				
				$(this).delay(2500).animate({opacity: .1}, 500);
					
						//animation complete
																				
			});
	
	});
	
	$('div#Abt div#News-Abt div.jspContainer div.jspPane .news-ctnr p a').attr('rel', 'press');	
//	Hides About and Contact Containers upon load and sets width to 430px after they are hidden
	$('div#Abt, div#Cntct').hide().css({width: 430});
	
//	Hides Artist Statement and Important Links Section in About Tab upon load
	$('#Art, #Imp_Lnks_Ctnr, #Rsm, #News-Abt').hide();
	
	
	
//	Begin About and Contact Tab button clicks
	var $sO		=	$('span#ovrly');
		$A		=	$('div#Abt');
		$C		=	$('div#Cntct');
//	END var
		
	$("#abt_btn, div#main-page-bio p a").click(function(){

    	$sO.addClass('overlay');
    	
    	$('.overlay').animate({opacity: .5}, 200, function(){
    		
    		$A.animate({width: 'toggle'}, 500, 'easeOutQuart');
    	
    	});
    	
    });
//	END $("#abt_btn").click
    
    $('#cntct_btn').click(function(){
    
    	$sO.addClass('overlay_Cntct');
        	
    	$('.overlay_Cntct').animate({opacity: .5}, 200, function(){
		
			$C.animate({width: 'toggle'}, 500, 'easeOutQuart');
		
		});
		
	});
//	//	END $("#cntct_btn").click
	
	$sO.click(function(){
    	
       	if($(this).hasClass('overlay')){
       	
       		$sO.removeClass('overlay').css({opacity: 0});
    		
    		$A.animate({width: 'toggle'}, 500, 'easeOutQuart');
    	
    	}
    	
    	else if($(this).hasClass('overlay_Cntct')){
    		
    		$sO.removeClass('overlay_Cntct').css({opacity: 0});
    		
    		$C.animate({width: 'toggle'}, 500, 'easeOutQuart');
    		    	    	
    	}	
    	
    });
//	END $sO.click
//	End About and Contact Tab button clicks
	
	
	
//	Begin About Section Functionality
 
	$('a#Art_Btn').click(function(){
	
		$('div#Bio, div#Imp_Lnks_Ctnr, div#Rsm, div#News-Abt').hide().stop();
		
		$('div#Art').slideDown(500);
	
	});
//	END $('a#Art_Btn').click

	$('a#Bio_Btn').click(function(){
	
		$('div#Art, div#Imp_Lnks_Ctnr, div#Rsm, div#News-Abt').hide().stop();
		
		$('div#Bio').slideDown(500);
	
	});
//	END $('a#Bio_Btn').click

	$('a#Lnks_Btn').click(function(){
	
		$('div#Art, div#Bio, div#Rsm, div#News-Abt').hide().stop();
		
		$('div#Imp_Lnks_Ctnr').slideDown(500);
	
	});
//	END $('a#Lnks_Btn').click
	
	$('a#Rsm_Btn').click(function(){
	
		$('div#Art, div#Bio, div#Imp_Lnks_Ctnr, div#News-Abt').hide().stop();
		
		$('div#Rsm').slideDown(500);
	
	});
//	END $('a#Rsm_Btn').click

$('a#News_Btn').click(function(){
	
		$('div#Art, div#Bio, div#Imp_Lnks_Ctnr, div#Rsm').hide().stop();
		
		$('div#News-Abt').slideDown(500);
	
	});
//	END $('a#Rsm_Btn').click	

//	End About Section Functionality


$('div#Abt div#News-Abt div.jspContainer div.jspPane p a#more-news').remove();
	
//	Begin Nav Emphasis Animations
	
	var $NavEmp =	$('span.Nav_Emp').stop(true, true);
//	END var

	$('a.Pnt').click(function(){
	
		$NavEmp.delay(350).animate({height: 0}, 300, function(){
			
			$(this).animate({marginLeft: 241, width: 68, opacity: .85}, 150, 'easeOutCirc', function(){
			
				$(this).animate({height: 15}, 1000, 'easeOutBounce');
			
					//animation complete
			
			});
			
		});
		
	});
//	END Animation ('a.Pnt').click()
	
	$('a#three-d').click(function(){
	
		$NavEmp.delay(350).animate({height: 0}, 300, function(){
		
			$(this).animate({marginLeft: 364, width: 110, opacity: .85}, 150, 'easeOutCirc', function(){
			
				$(this).animate({height: 15}, 800, 'easeOutBounce');
				
					//animation complete
				
			});

		});
	
	});
//	END Animation ('a.three-d').click()
	
	$('a#Func').click(function(){
	
		$NavEmp.delay(350).animate({height: 0}, 300, function(){
			
			$(this).animate({marginLeft: 529, width: 89, opacity: .85}, 150, 'easeOutCirc', function(){
		
				$(this).animate({height: 15}, 800, 'easeOutBounce');
		
					//animation complete
		
			});
		
		});	
		
	});
	
	$('a#Photos').click(function(){
	
		$NavEmp.delay(350).animate({height: 0}, 300, function(){
			
			$(this).animate({marginLeft: 673, width: 104, opacity: .85}, 150, 'easeOutCirc', function(){
		
				$(this).animate({height: 15}, 800, 'easeOutBounce');
		
					//animation complete
		
			});
		
		});	
		
	});
//	END Animation ('a.Func').click()
//	End Nav Emphasis Animations
	
		
	
//	Assigns Browser specific class to 'html' tag based on which Browser is being used
	var params = [];
//	END var

		$.each($.browser, function(k, v) {
  	
  			if(/^[a-z].*/i.test(k)) { params.push(k); }
	
		});
	
	params = params.join(' ');
	
		$('html').addClass(params);
			
	});	
//END jQuery

	







































