$(document).ready(function()
{
	//SETUP NAV ROLLOVERS
	$("#navigation a").hover(
		function()
		{
			if(!$(this).hasClass('nav-current'))
			{
				//MOUSE OVER
				/*$(this).children("span").children("img").stop().animate(
					{opacity: 1}, 
					{
						duration: 500,
						easing: 'easeOutQuad'
					}
				);*/
				$(this).children("span").css("display", "block");
			}
		},
		function()
		{
			if(!$(this).hasClass('nav-current'))
			{
				//MOUSE OUT
				/*$(this).children("span").children("img").stop().animate(
					{opacity: 0}, 
					{
						duration: 250,
						easing: 'easeOutQuad'
					}
				);*/
				$(this).children("span").css("display", "none");
			}
		}
	);
	
	//SETUP ABOUT TEAM MEMBERS ROLLOVER
	$(".team-member").hover(
		function()
		{
			//MOUSE OVER
			/*$(this).children("span").stop().animate(
				{opacity: 1}, 
				{
					duration: 500,
					easing: 'easeOutQuad'
				}
			);
			
			$(this).children(".team-member-name").stop().animate(
				{color: "#FFFFFF"}, 
				{
					duration: 500,
					easing: 'easeOutQuad'
				}
			);*/
			$(this).children("span").css("display", "block");
			$(this).children(".team-member-name").css("color", "#FFFFFF");
		},
		function()
		{
			//MOUSE OUT
			/*$(this).children("span").stop().animate(
				{opacity: 0}, 
				{
					duration: 250,
					easing: 'easeOutQuad'
				}
			);
			
			$(this).children(".team-member-name").stop().animate(
				{color: "#CC3333"}, 
				{
					duration: 250,
					easing: 'easeOutQuad'
				}
			);*/
			$(this).children("span").css("display", "none");
			$(this).children(".team-member-name").css("color", "#CC3333");
		}
	);
	
	//ADD ROUNDED CORNERS TO SOLUTIONS BOXES
	$('.solutions-box').corner(
	{
		bl: {radius: 12},
		tr: {radius: 12}
	});	
});

function initGoogleMaps()
{
	var myLatlng = new google.maps.LatLng(30.3162436, -97.7181836);
	var myOptions =
	{
		zoom: 13,
		center: myLatlng,
		mapTypeId: google.maps.MapTypeId.ROADMAP
	}
	
	var map = new google.maps.Map(document.getElementById("contact-map"), myOptions);
	
	//ADDRESS FOR INFO WINDOW
	var infoWindowContent = '<p class="mapInfoWindow">504 E 53rd St.<br />' +
			  					'Austin, TX 78751<br />' + 
			  					'(512) 371-7046<br />' + 
			  					'<a href="http://www.lavastudios.net">www.lavastudios.net</a>' +
			  				'</p>';
	
	//INFO WINDOW
	var infowindow = new google.maps.InfoWindow(
	{
        content: infoWindowContent
    });
	
	//ADD MARKER
	var marker = new google.maps.Marker(
	{
        position: myLatlng, 
        map: map,
        title:"Lava Studios"
    }); 
    
    //OPEN INFO WINDOW 
    infowindow.open(map, marker);
    map.panBy(0, 100);
    
    //ADD LISTENER FOR CLICK
    google.maps.event.addListener(marker, 'click', function()
    {
    	infowindow.open(map,marker);
    });
}

function switchSlides()
{
    var current = $('#slideshow-quotes img.current-slide');

    if(current.length == 0) current = $('#slideshow-quotes img:last');

    // use this to pull the images in the order they appear in the markup
    var next =  current.next().length ? current.next() : $('#slideshow-quotes img:first');

    current.addClass('previous-slide');

    next.css({opacity: 0.0})
        .addClass('current-slide')
        .animate({opacity: 1.0}, 500, function() {
            current.removeClass('current-slide previous-slide');
        });
}


function initSlideshow()
{
	setInterval("switchSlides()", 5000);
}
