$(document).ready(function() {
	$("ul.menu-slider li.slide a.head_slide_link_open").toggle(
		function() {    
			if($(this).next('ul').css("display") == "block"){
				$(this).next('ul').slideUp('slow');
				$(this).attr('class', 'head_slide_link_closed');
			}else{
				$(this).next('ul').slideDown('slow');
				$(this).attr('class', 'head_slide_link_open');
			}
			return false;
		},
		function() {
			if($(this).next('ul').css("display") == "none"){
				$(this).next('ul').slideDown('slow');
				$(this).attr('class', 'head_slide_link_open');
			}else{
				$(this).next('ul').slideUp('slow');
				$(this).attr('class', 'head_slide_link_closed');
			}      
			return false;
	});
	
	function validate_email(email){
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		if(reg.test(email) == false) {
			return false;	
		}else{
			return true;	
		}
	}
	
	$('#email_updates').submit(function(){
		var email_error = '';
		if(!validate_email(document.getElementById('email_address').value)){
			email_error+='Please specify a valid email address.'+"\n";	
		}
		
		if (email_error != '') {
			alert(email_error);
			return false;
		}else{
			alert('Thank you for your interest! Have a nice day!');	
		}
	});
	
	$(function(){
		$('#education_pane').jScrollPane({showArrows:true,scrollbarWidth :0});
	});
	
	$(function() {
		$('a.gallery').lightBox({fixedNavigation:true});
	});
	
	$('#menu > ul > li').hover(function() {
        $(this).find('ul#drop_links').css('display', 'block');
	},function() {
        $(this).find('ul#drop_links').css('display', 'none');
	});
});

$(window).load(function() {
						
	$('#studio_slider').cycle({ 
		fx:     'fade', 
		speed:  'slow', 
		timeout: 0, 
		next:   '#next', 
		prev:   '#prev' 
	});

	$('#artist_paragraphs').jScrollPane({showArrows:true,scrollbarWidth :0});
					
});

