$(document).ready(function() {

// =============================
// DROP-DOWN NAVIGATION
// =============================

	jQuery(".drop ul").css({display: "none"}); // Opera Fix 
	jQuery(".drop li").hover(function(){ 
	jQuery(this).find('ul:first').css({visibility: "visible",display: "none"}).show(268); 
	},function(){ 
		jQuery(this).find('ul:first').css({visibility: "hidden"}); 
	}); 


// ============================================
// GENERAL ID'S AND CLASSES FOR ACTIONS
// ============================================

	// Hide on load
    $( '.hide-on-load' ).hide();
	
	// Hide parent element
	$( '#hide-parent' ).click(function() {
	$( this ).parent().parent().hide(500);
	return false;
	});

	// Toggle the next sibling of the parent element.
	$( '#toggle-next' ).click(function(){
	$( this ).parent().next().toggle(500);
	return false;
	});


// ===================
// PUBLISHED WORK
// ===================


    // Hides everything except the 'news' category.
    $( 'a#show-date' ).click(function() {
	$( '#date' ).show(350);
	$( '#news' ).hide();
    $( '#politics' ).hide();
	$( '#sports' ).hide();
	$( '#instructional' ).hide();
	return false;
    });

    // Hides everything except the 'news' category.
    $( 'a#show-news' ).click(function() {
	$( '#news' ).show(350);
	$( '#politics' ).hide();
	$( '#date' ).hide();
	$( '#sports' ).hide();
	$( '#instructional' ).hide();
	return false;
    });

    // Hides everything except the 'sports' category.
    $( 'a#show-sports' ).click(function() {
	$( '#politics' ).hide();
	$( '#sports' ).show(350);
	$( '#date' ).hide();
	$( '#news' ).hide();
	$( '#instructional' ).hide();
	return false;
    });

    // Hides everything except the 'instructional' category.
    $( 'a#show-instructional' ).click(function() {
	$( '#politics' ).hide();
	$( '#instructional' ).show(350);
	$( '#date' ).hide();
	$( '#news' ).hide();
	$( '#sports' ).hide();
	return false;
    });
    
    // Hides everything except the 'politics' category.
    $( 'a#show-politics' ).click(function() {
	$( '#politics' ).show(350);
	$( '#instructional' ).hide();
	$( '#date' ).hide();
	$( '#news' ).hide();
	$( '#sports' ).hide();
	return false;
    });
    

// ========================================
// PAGE NAVIGATION
// ========================================

    // Shows everything.
    $( 'a#show-all' ).click(function() {
	$( '#quick' ).show();
	$( '#about' ).show();
	$( '#work' ).show();
	$( '#contact' ).show();
	$( '#testimonials' ).show();
	$( '#services' ).show();
	return false;
    });

    // Shows the "About" section and hides everything else.
    $( 'a#show-about' ).click(function() {
	$( '#about' ).show();
	$( '#services' ).hide();
	$( '#work' ).hide();
	$( '#testimonials' ).hide();
	$( '#quick' ).hide();
	return false;
    });

    // Shows the "Services" section and hides everything else.
	$( 'a#show-services' ).click(function() {
	$( '#services' ).show();
	$( '#about' ).hide();
	$( '#work' ).hide();
	$( '#testimonials' ).hide();
	$( '#quick' ).hide();
	return false;
    });

    // Shows the "Work" section and hides everything else.
	$( 'a#show-work' ).click(function() {
	$( '#work' ).show();
	$( '#about' ).hide();
	$( '#services' ).hide();
	$( '#testimonials' ).hide();
	$( '#quick' ).hide();
	return false;
    });

    // Shows the "Contact" section and hides everything else.
	$( 'a#show-contact' ).click(function() {
	$( '#contact' ).show();
	$( '#about' ).hide();
	$( '#services' ).hide();
	$( '#work' ).hide();
	$( '#testimonials' ).hide();
	$( '#quick' ).hide();
	return false;
    });

    // Shows the "Testimonials" section and hides everything else.
    $( 'a#show-testimonials' ).click(function() {
	$( '#testimonials' ).show();
	$( '#about' ).hide();
	$( '#work' ).hide();
	$( '#services' ).hide();
	$( '#quick' ).hide();
	return false;
    });

    // Shows the "Quick Facts" section and hides everything else.
    $( 'a#show-quick' ).click(function() {
	$( '#quick' ).show();
	$( '#about' ).hide();
	$( '#work' ).hide();
	$( '#testimonials' ).hide();
	$( '#services' ).hide();
	return false;
    });


// ========================================
// COPYWRITING SERVICES
// ========================================


    // Shows consulting and hides everything else. 
    $( 'a#show-consulting' ).click(function() {
	$( '#consulting' ).show( 350 );
	$( '#web' ).hide( 350 );
	$( '#case' ).hide( 350 );
	$( '#other' ).hide( 350 );
	$( '#how').hide( 350 );
	return false;
    });

    // Shows website copy and hides everything else. 
    $( 'a#show-web' ).click(function() {
	$( '#web' ).show( 350 );
	$( '#consulting' ).hide( 350 );
	$( '#case' ).hide( 350 );
	$( '#other' ).hide( 350 );
	$( '#how').hide( 350 );
	return false;
    });


    // Shows case studies and hides everything else. 
    $( 'a#show-case' ).click(function() {
	$( '#case' ).show( 350 );
	$( '#consulting' ).hide( 350 );
	$( '#web' ).hide( 350 );
	$( '#other' ).hide( 350 );
	$( '#how').hide( 350 );
	return false;
    });

    // Shows other services and hides everything else. 
    $( 'a#show-other' ).click(function() {
	$( '#other' ).show( 350 );
	$( '#consulting' ).hide( 350 );
	$( '#web' ).hide( 350 );
	$( '#case' ).hide( 350 );
	$( '#how' ).hide( 350 );
	return false;
    });

    // Shows the "how my services work" section and hides everything else. 
    $( 'a#show-how' ).click(function() {
	$( '#how' ).show( 350 );
	$( '#web' ).hide( 350 );
	$( '#case' ).hide( 350 );
	$( '#other' ).hide( 350 );
	$( '#consulting').hide( 350 );
	return false;
    });

});

