$(document).ready(function() {
	
	/********************************************************************************************************************
	NAV
	********************************************************************************************************************/	
	$('#nav h2.slide, #faqs h2').click(function() {
		$('#nav div, #faqs p').slideUp('normal');	
		$(this).next().slideDown('normal');
	});
	
	//SubNav
	$('#nav div ul li a.subslide').click(function() {
		$('#nav div ul li div').slideUp('normal');
		$(this).next().slideDown('normal');
	});
	
	//subsubnav
	$('#nav div ul li a.subsubslide').click(function() {
													 $(this).next().slideDown('normal');
													 });
	
	$('#nav div ul li div, #nav div, #faqs p').hide();
	
	
	
	/********************************************************************************************************************
	Video Embeds
	********************************************************************************************************************/
	$('#texmexvidswitch').click(function (){
											//$('#texmexvidimg').hide();
											//$('#texmexvid').show();
											$(this).replaceWith('<iframe width="560" height="315" src="http://www.youtube.com/embed/A1-kn-qr2aY?autoplay=1" frameborder="0" allowfullscreen></iframe>');
											});


	/********************************************************************************************************************
	Photo Gallery
	********************************************************************************************************************/	
		$('.galleryview').galleryView({
			panel_width: 600,
			panel_height: 395,
			frame_width: 50,
			frame_height: 50
		});
		
	$('#video').cycle({ 
    fx:     'fade', 
    speed:  'fast', 
    timeout: 0, 
    next:   '#next2', 
    prev:   '#prev2' 
});
	
	$('a[rel*=facebox]').facebox({
		loadingImage : 'js/facebox/loading.gif',
		closeImage   : 'js/facebox/closelabel.png'
	})
	
	
    var $div = $('#opt-in #cc_form');
    var height = $div.height();
    $div.hide().css({ height : 0 });
 
    $('#opt-in p').click(function () {
        if ($div.is(':visible')) {
            $div.animate({ height: 0 }, { duration: 1000, complete: function () {
                $div.hide();
            } });
        } else {
            $div.show().animate({ height : height }, { duration: 1000 });
        }
        
        return false;
    });
});

