
	function showAboutSub() {
		$('.subNavBar').animate({top: "161px"}, 250);
		$('.subNavLine').animate({top: "161px"}, 250);
		$('.aboutSubNavigation').fadeIn();
		$('.talentSubNavigation').fadeOut();
		$('.footerSubNavBar').animate({top: "40px"}, 250);
		$('.footerNavLine').animate({top: "40px"}, 250);
		$('.aboutFooterSubNavigation').fadeOut();
		$('.talentFooterSubNavigation').fadeOut();
		return false;
	}
	
	function showTalentSub() {
		$('.subNavBar').animate({top: "161px"}, 250);
		$('.subNavLine').animate({top: "161px"}, 250);
		$('.talentSubNavigation').fadeIn();
		$('.aboutSubNavigation').fadeOut();
		$('.footerSubNavBar').animate({top: "40px"}, 250);
		$('.footerNavLine').animate({top: "40px"}, 250);
		$('.aboutFooterSubNavigation').fadeOut();
		$('.talentFooterSubNavigation').fadeOut();
		return false;
	}
	
	function showFooterAboutSub() {
		$('.footerSubNavBar').animate({top: "-11px"}, 250);
		$('.footerNavLine').animate({top: "-11px"}, 250);
		$('.aboutFooterSubNavigation').fadeIn();
		$('.talentFooterSubNavigation').fadeOut();
		$('.subNavBar').delay(250).animate({top: "130px"}, 250);
		$('.subNavLine').delay(250).animate({top: "130px"}, 250);
		$('.aboutSubNavigation').fadeOut();
		$('.talentSubNavigation').fadeOut();
		return false;
	}
	
	function showFooterTalentSub() {
		$('.footerSubNavBar').animate({top: "-11px"}, 250);
		$('.footerNavLine').animate({top: "-11px"}, 250);
		$('.talentFooterSubNavigation').fadeIn();
		$('.aboutFooterSubNavigation').fadeOut();
		$('.subNavBar').animate({top: "130px"}, 250);
		$('.subNavLine').animate({top: "130px"}, 250);
		$('.aboutSubNavigation').fadeOut();
		$('.talentSubNavigation').fadeOut();
		return false;
	}
	
	function hideSubNav() {
		$('.subNavBar').animate({top: "130px"}, 250);
		$('.subNavLine').animate({top: "130px"}, 250);
		$('.aboutSubNavigation').fadeOut();
		$('.talentSubNavigation').fadeOut();
		return false;
	}
	
	function searchFocus(element) {
		if (element.value == element.defaultValue) {
			element.value = "";
		} else if (element.value == "") {
			element.value = element.defaultValue;
		}
	}
	
	$(function() {
    	$('#slider').nivoSlider({
        	effect:'slideInLeft', // Specify sets like: 'fold,fade,sliceDown'
        	slices:15, // For slice animations
        	boxCols: 8, // For box animations
        	boxRows: 4, // For box animations
        	animSpeed:500, // Slide transition speed
        	pauseTime:10000, // How long each slide will show
        	startSlide:0, // Set starting Slide (0 index)
        	directionNav:false, // Next & Prev navigation
        	directionNavHide:false, // Only show on hover
    	});
	});
	
	$(document).ready(function () {
       $('#coda-slider-1').codaSlider({
       });
   	});
   	
   	function showSocial(className) {
		$('.'+className).stop().animate({marginTop: "0px"}, 200);
		return false;
	}
	
	function hideSocial(className) {
		$('.'+className).stop().animate({marginTop: "10px"}, 200);
		return false;
	}
	
	function showShare(className) {
		$('.'+className).stop().animate({marginTop: "4px"}, 200);
		return false;
	}
	
	function hideShare(className) {
		$('.'+className).stop().animate({marginTop: "-6px"}, 200);
		return false;
	}
	
	function showConnect(className) {
		$('.'+className).stop().animate({marginTop: "20px"}, 200);
		return false;
	}
	
	function hideConnect(className) {
		$('.'+className).stop().animate({marginTop: "30px"}, 200);
		return false;
	}
	
	
	function hoverArrowLeft() {
		$('.nivo-prevNav').css("background-position","0px bottom");
	}
	
	function hoverArrowRight() {
		$('.nivo-nextNav').css("background-position","-60px bottom");
	}
	
	function hoverClient (client) {
		$('#'+client).mouseover(function () {
			$('#'+client).css("background","#00283c");
		});
		return false;
	}
	
	function hoverClientOut (client) {
		$('#'+client).mouseout(function () {
			$('#'+client).css("background","#f6f6f6");
		});
		return false;
	}
	
	function toggleFAQ(faq,arrow) {
		$('#'+faq).slideToggle();
		return false;
	}
	
	//DEDICATED PAGE
	function clientBio() {
		$('#clientResume').fadeOut(200);
		$('#clientVideos').fadeOut(200);
		$('#clientPress').fadeOut(200);
		$('#clientLinks').fadeOut(200);
		$('.dedicatedNavigation').fadeOut(100);
		$('.dedicatedNavigation').delay(200).fadeIn(200);
		$('#clientBio').delay(200).fadeIn(200);
		return false;
	}
	
	function clientResume() {
		$('#clientBio').fadeOut(200);
		$('#clientVideos').fadeOut(200);
		$('#clientPress').fadeOut(200);
		$('#clientLinks').fadeOut(200);
		$('.dedicatedNavigation').fadeOut(100);
		$('.dedicatedNavigation').delay(200).fadeIn(200);
		$('#clientResume').delay(200).fadeIn(200);
		return false;
	}
	
	function clientVideos() {
		$('#clientResume').fadeOut(200);
		$('#clientBio').fadeOut(200);
		$('#clientPress').fadeOut(200);
		$('#clientLinks').fadeOut(200);
		$('.dedicatedNavigation').fadeOut(100);
		$('.dedicatedNavigation').delay(200).fadeIn(200);
		$('#clientVideos').delay(200).fadeIn(200);
		return false;
	}
	
	function clientPress() {
		$('#clientResume').fadeOut(200);
		$('#clientVideos').fadeOut(200);
		$('#clientBio').fadeOut(200);
		$('#clientLinks').fadeOut(200);
		$('.dedicatedNavigation').fadeOut(100);
		$('.dedicatedNavigation').delay(200).fadeIn(200);
		$('#clientPress').delay(200).fadeIn(200);
		return false;
	}
	
	function clientLinks() {
		$('#clientResume').fadeOut(200);
		$('#clientVideos').fadeOut(200);
		$('#clientPress').fadeOut(200);
		$('#clientBio').fadeOut(200);
		$('.dedicatedNavigation').fadeOut(100);
		$('.dedicatedNavigation').delay(200).fadeIn(200);
		$('#clientLinks').delay(200).fadeIn(200);
		return false;
	}
	
	function hoverVid(video) {
		$('#'+video).css("background","#DCDCDC");
		return false;
	}
	
	function hoverVidOut(video) {
		$('#'+video).css("background","transparent");
		return false;
	}
	
	//DEDICATED PHOTO SCROLLER
	function slidePhotosRight() {
		$('.photoScrollInner').animate({right: "530px"},200);
		return false;
	}
	
	function slidePhotosLeft() {
		$('.photoScrollInner').animate({right: "0px"},200);
		return false;
	}
	
	//TOUR GALLERY
	function hoverGallery() {
		$('.roadImgLink').css("opacity","1.0","filter","alpha(opacity=100)","-ms-filter","progid:DXImageTransform.Microsoft.Alpha(Opacity=100)");
	}
	
	function hoverGalleryOut() {
		$('.roadImgLink').css("opacity","0.3","filter","alpha(opacity=30)","-ms-filter","progid:DXImageTransform.Microsoft.Alpha(Opacity=30)");
	}
	
	//VIDEO OF THE WEEK
	function hoverVid() {
		$('.vidWeekLink').css("opacity","1.0","filter","alpha(opacity=100)","-ms-filter","progid:DXImageTransform.Microsoft.Alpha(Opacity=100)");
	}
	
	function hoverVidOut() {
		$('.vidWeekLink').css("opacity","0.3","filter","alpha(opacity=30)","-ms-filter","progid:DXImageTransform.Microsoft.Alpha(Opacity=30)");
	}
	
	//DANCE NEWS
	function showDanceNews(article,readMore,readLess) {
		$('#'+article).css("height","100%");
		$('#'+readMore).css("display","none");
		$('#'+readLess).css("display","block");
		return false;
	}
	
	function hideDanceNews(article,readMore,readLess) {
		$('#'+article).css("height","70px");
		$('#'+readMore).css("display","block");
		$('#'+readLess).css("display","none");
		return false;
	}
	
	//TOUR
	function showTour(clients) {
		$('#'+clients).slideToggle();
		return false;
	}
	
	function overTour(tour) {
		$('#'+tour).css("background","#00283c");
		return false;	
	}
	
	function overTourOut(tour) {
		$('#'+tour).css("background","#FFF");
		return false;	
	}
	
	//CONTACT FORM
	function checkForm() {
		
		var contactFirstName = $('#contactFirstName');
		var contactLastName = $('#contactLastName');
		var contactEmail = $('#contactEmail');
		var contactSubject = $('#contactSubject');
		var contactMessage = $('#contactMessage');
		var errorMsg = $('#errMsg');
		
		if(contactFirstName.val() == 0) {
			contactFirstName.removeClass('contactField');
			contactFirstName.addClass('errorField');
			errorMsg.show();
		} else {
			contactFirstName.removeClass('errorField');
			contactFirstName.addClass('contactField');
		}
		
		if(contactLastName.val() == 0) {
			contactLastName.removeClass('contactField');
			contactLastName.addClass('errorField');
			errorMsg.show();
		} else {
			contactLastName.removeClass('errorField');
			contactLastName.addClass('contactField');
		}
		
		if(contactEmail.val() == 0) {
			contactEmail.removeClass('contactField');
			contactEmail.addClass('errorField');
			errorMsg.show();
		} else {
			contactEmail.removeClass('errorField');
			contactEmail.addClass('contactField');
		}
		
		if(contactSubject.val() == "") {
			contactSubject.removeClass('contactField');
			contactSubject.addClass('errorField');
			errorMsg.show();
		} else {
			contactSubject.removeClass('errorField');
			contactSubject.addClass('contactField');
		}
		
		if(contactMessage.val() == 0 || contactMessage.val() == "write something...") {
			contactMessage.removeClass('contactTextArea');
			contactMessage.addClass('errorTextArea');
			errorMsg.show();
		} else {
			contactMessage.removeClass('errorTextArea');
			contactMessage.addClass('contactTextArea');
		}
		
		if(contactFirstName.val() != 0 && contactLastName.val() != 0 && contactEmail.val() != 0 && contactSubject.val() != 0 && contactMessage.val() != 0) {
			return true;
		}
		return false;
	}
	
	
	//AJAX
	function getLegacy(page) {
		if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
		  xmlhttp=new XMLHttpRequest();
		} else {// code for IE6, IE5
		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4 && xmlhttp.status==200) {
				document.getElementById("getLegacy").innerHTML=xmlhttp.responseText;
			} else {
				$('#getLegacy').html('<div style="position:relative; float:left; margin:0px 0px 0px 390px;"><img src="/images/ajax-loader.gif" alt="" /></div>');
			}
		}
		xmlhttp.open("GET","/legacy/fetch_legacy.php?p="+page, true);
		xmlhttp.send();
		return false;
	}
	
	
	function getChoreographers(page,sortClients) {
		if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
		  xmlhttp=new XMLHttpRequest();
		} else {// code for IE6, IE5
		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4 && xmlhttp.status==200) {
				document.getElementById("getChoreographers").innerHTML=xmlhttp.responseText;
			} else {
				$('getChoreographers').html('<div style="position:relative; float:left; margin:0px 0px 0px 390px;"><img src="/images/ajax-loader.gif" alt="" /></div>');
			}
		}
		xmlhttp.open("GET","/choreographers/fetch_choreographers.php?p="+page+"&sort="+sortClients, true);
		xmlhttp.send();
		return false;
	}
	
	function chorSearch(results) {
		if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
			  xmlhttp=new XMLHttpRequest();
			} else {// code for IE6, IE5
			  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			
			xmlhttp.onreadystatechange=function() {
				if (xmlhttp.readyState==4 && xmlhttp.status==200) {
					document.getElementById("getChoreographers").innerHTML=xmlhttp.responseText;
				}
			}
			xmlhttp.open("GET","/choreographers/search.php?q="+results, true);
			xmlhttp.send();
			return false;
	}
	
	
	function getDirectors(page,sortClients) {
		if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
		  xmlhttp=new XMLHttpRequest();
		} else {// code for IE6, IE5
		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4 && xmlhttp.status==200) {
				document.getElementById("getDirectors").innerHTML=xmlhttp.responseText;
			} else {
				$('#getDirectors').html('<div style="position:relative; float:left; margin:0px 0px 0px 390px;"><img src="/images/ajax-loader.gif" alt="" /></div>');
			}
		}
		xmlhttp.open("GET","/directors/fetch_directors.php?p="+page+"&sort="+sortClients, true);
		xmlhttp.send();
		return false;
	}
	
	
	function getActors(page,sortClients) {
		if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
		  xmlhttp=new XMLHttpRequest();
		} else {// code for IE6, IE5
		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4 && xmlhttp.status==200) {
				document.getElementById("getActors").innerHTML=xmlhttp.responseText;
			} else {
				$('#getActors').html('<div style="position:relative; float:left; margin:0px 0px 0px 390px;"><img src="/images/ajax-loader.gif" alt="" /></div>');
			}
		}
		xmlhttp.open("GET","/actors/fetch_actors.php?p="+page+"&sort="+sortClients, true);
		xmlhttp.send();
		return false;
	}
	
	
	function getSingers(page,sortClients) {
		if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
		  xmlhttp=new XMLHttpRequest();
		} else {// code for IE6, IE5
		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4 && xmlhttp.status==200) {
				document.getElementById("getSingers").innerHTML=xmlhttp.responseText;
			} else {
				$('#getSingers').html('<div style="position:relative; float:left; margin:0px 0px 0px 390px;"><img src="/images/ajax-loader.gif" alt="" /></div>');
			}
		}
		xmlhttp.open("GET","/singers/fetch_singers.php?p="+page+"&sort="+sortClients, true);
		xmlhttp.send();
		return false;
	}
	
	
	function getTeachers(page,genre) {
		if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
		  xmlhttp=new XMLHttpRequest();
		} else {// code for IE6, IE5
		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4 && xmlhttp.status==200) {
				document.getElementById("getTeachers").innerHTML=xmlhttp.responseText;
			} 
		}
		xmlhttp.open("GET","/educators/fetch_teachers.php?p="+page+"&sort="+genre, true);
		xmlhttp.send();
		return false;
	}
	
	
	function getActs(page,sortClients) {
		if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
		  xmlhttp=new XMLHttpRequest();
		} else {// code for IE6, IE5
		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4 && xmlhttp.status==200) {
				document.getElementById("getActs").innerHTML=xmlhttp.responseText;
			} else {
				$('#getActs').html('<div style="position:relative; float:left; margin:0px 0px 0px 390px;"><img src="/images/ajax-loader.gif" alt="" /></div>');
			}
		}
		xmlhttp.open("GET","/specialty/fetch_acts.php?p="+page+"&sort="+sortClients, true);
		xmlhttp.send();
		return false;
	}
	
	
	function getResults(page) {
		if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
		  xmlhttp=new XMLHttpRequest();
		} else {// code for IE6, IE5
		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4 && xmlhttp.status==200) {
				document.getElementById("getResults").innerHTML=xmlhttp.responseText;
			} else {
				$('#getResults').html('<div style="position:relative; float:left; margin:0px 0px 0px 390px;"><img src="/images/ajax-loader.gif" alt="" /></div>');
			}
		}
		xmlhttp.open("GET","/speciality/fetch_acts.php?p="+page, true);
		xmlhttp.send();
		return false;
	}
	
	
	function getNews(page,genre) {
		if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
		  xmlhttp=new XMLHttpRequest();
		} else {// code for IE6, IE5
		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4 && xmlhttp.status==200) {
				document.getElementById("getNews").innerHTML=xmlhttp.responseText;
			} else {
				$('#getNews').html('<div style="position:relative; float:left; margin:10px 0px 20px 220px;"><img src="/images/ajax-loader.gif" alt="" /></div>');
			}
		}
		xmlhttp.open("GET","/news/fetch_news.php?p="+page+"&sort="+genre, true);
		xmlhttp.send();
		return false;
	}
	
	
	function getDanceMedia(page) {
		if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
		  xmlhttp=new XMLHttpRequest();
		} else {// code for IE6, IE5
		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4 && xmlhttp.status==200) {
				document.getElementById("getMedia").innerHTML=xmlhttp.responseText;
				Shadowbox.init({ skipSetup: true }); Shadowbox.setup();
			} 
		}
		xmlhttp.open("GET","/talentLA/fetch_media.php?p="+page, true);
		xmlhttp.send();
		return false;
	}
	
	
	function getDanceClips(page) {
		if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
		  xmlhttp=new XMLHttpRequest();
		} else {// code for IE6, IE5
		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4 && xmlhttp.status==200) {
				document.getElementById("getClips").innerHTML=xmlhttp.responseText;
				Shadowbox.init({ skipSetup: true }); Shadowbox.setup();
			}
		}
		xmlhttp.open("GET","/educators/fetch_clips.php?p="+page, true);
		xmlhttp.send();
		return false;
	}
	
	
	function getDanceNYMedia(page) {
		if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
		  xmlhttp=new XMLHttpRequest();
		} else {// code for IE6, IE5
		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4 && xmlhttp.status==200) {
				document.getElementById("getMedia").innerHTML=xmlhttp.responseText;
				Shadowbox.init({ skipSetup: true }); Shadowbox.setup();
			}
		}
		xmlhttp.open("GET","/talentNY/fetch_media.php?p="+page, true);
		xmlhttp.send();
		return false;
	}
	
	/*NAME TAGS*/
	function showTag(name) {
		$('#'+name).show();
		return false;
	}
	
	function hideTag(name) {
		$('#'+name).hide();
		return false;
	}
	
	function shareWindow(URL) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=800,height=500,left = 710,top = 290');");
		return false;
	}
	
	/*MSA STAFF*/
	function showChorStaff() {
		$('#chorTD').slideToggle(200);
		return false;
	}
	
	function showDanceStaff() {
		$('#danceTD').slideToggle(200);
		return false;
	}
	
	function showMSAStaff() {
		$('#staffTD').slideToggle(200);
		return false;
	}
	
	function showNYStaff() {
		$('#nyTD').slideToggle(200);
		return false;
	}
	
	function goLeft(px,season) {
		if($('#scroller'+season).animate({marginLeft: "0px"})) {
		} else {
			$('#scroller'+season).animate({
				'marginLeft' : px
			});	
		}
		return false;
	}
	
	function goRight(px,season) {
		$('#scroller'+season).animate({
			'marginLeft' : px
		});
		return false;
	}
	
	/*SEARCH*/
	function searchChorField(element) {
		if (element.value == element.defaultValue) {
			element.value = "";
			$('#enter').fadeIn(200);
			return false;
		} else if (element.value == "") {
			element.value = element.defaultValue;
			$('#enter').fadeOut(200);
			return false;
		}
	}
	
	function showChorSearch() {
		$('.searchOverlay').fadeIn(250);
		$('.searchChorContainer').fadeIn(250);
		$('.reelImage').hide();
		return false;
	}
	
	function hideChorSearch() {
		$('.searchChorContainer').fadeOut(250);
		$('.searchOverlay').fadeOut(250);
		return false;
		$('.reelImage').show();
	}
	
	function showDirSearch() {
		$('.searchDirOverlay').fadeIn(250);
		$('.searchDirectorContainer').fadeIn(250);
		$('.reelImage').hide();
		return false;
	}
	
	function hideDirSearch() {
		$('.searchDirectorContainer').fadeOut(250);
		$('.searchDirOverlay').fadeOut(250);
		$('.reelImage').show();
		return false;
	}
