function toggleTeamPopup(id) {

    // Hide the others
    hideTeamPopups();

    // Show/Hide the appropriate one
    $('#' + id).toggle();

}

function hideTeamPopups() {
    $('.team_popup').each(function(e) {
        $(this).hide();
    });
}

function bounceIn(id) {
    hideSlides();
    $('#' + id).show()
    .animate(
    { left: -120 }, {
        duration: 'slow',
        easing: 'easeOutBounce'
    })
   .animate(
    { left: 0 }, {
        duration: 'slow',
        easing: 'easeOutBounce'
    });
}


function hideSlides() {
    $('.slide_content').each(function(e) {
        $(this).hide();
    });
}

// Team Hovers
var last_used_eid = 0;
toggleBox = function(eid, navid) {

    this.t = null;
    this.eid = eid;
    this.navid = navid;

    this.hit = function() {

        if (last_used_eid != 0 && last_used_eid != this.eid) {
            $(last_used_eid).hide();
        }

        if (this.t) {
            clearTimeout(this.t);
        }

        if (this.navid) {
            $(this.navid).addClass("ddhover");
            $(this.navid).removeClass("dddefault");
        }
        last_used_eid = this.eid;
        $(this.eid).fadeIn("fast");

    }

    this.moff = function() {

        if (this.navid) {
            $(this.navid).addClass("dddefault");
            $(this.navid).removeClass("ddhover");
        }

        this.t = setTimeout('$("' + this.eid + '").hide();', 300);
    }

}

// Definitions
jdoolin = new toggleBox("#data_jdoolin", "#nav_jdoolin");
wdoolin = new toggleBox("#data_wdoolin", "#nav_wdoolin");
bschaffler = new toggleBox("#data_bschaffler", "#nav_bschaffler");
koden = new toggleBox("#data_koden", "#nav_koden");
mpapaleo = new toggleBox("#data_mpapaleo", "#nav_mpapaleo");
nthomas = new toggleBox("#data_nthomas", "#nav_nthomas");
spatel = new toggleBox("#data_spatel", "#nav_spatel");
vfernandez = new toggleBox("#data_vfernandez", "#nav_vfernandez");
mharms = new toggleBox("#data_mharms", "#nav_mharms");
knash = new toggleBox("#data_knash", "#nav_knash");
gmontgomery = new toggleBox("#data_gmontgomery", "#nav_gmontgomery");
cwynne = new toggleBox("#data_cwynne", "#nav_cwynne");
cfisher = new toggleBox("#data_cfisher", "#nav_cfisher");
sdawson = new toggleBox("#data_sdawson", "#nav_sdawson");
jhubert = new toggleBox("#data_jhubert", "#nav_jhubert");

/* For Services tabs... */
function hideHowWorkTabs() {

	$('#howwork1_content').hide();
	$('#howwork2_content').hide();
	$('#howwork3_content').hide();
	$('#howwork4_content').hide();
	
	$('#tab_howwork1').removeClass('active');
	$('#tab_howwork2').removeClass('active');
	$('#tab_howwork3').removeClass('active');
	$('#tab_howwork4').removeClass('active');
	
}

function showHowWorkContent(num) {
	hideHowWorkTabs();
	$('#howwork' + num + '_content').fadeIn();
	$('#tab_howwork' + num).addClass('active');
	return false;
}

function hideServiceTabs() {

	$('#tab1_content').hide();
	$('#tab2_content').hide();
	$('#tab3_content').hide();
	$('#tab4_content').hide();
	$('#tab5_content').hide();
	$('#tab6_content').hide();
	$('#tab7_content').hide();
	
	$('#tab_item1').removeClass('over');
	$('#tab_item2').removeClass('over');
	$('#tab_item3').removeClass('over');
	$('#tab_item4').removeClass('over');
	$('#tab_item5').removeClass('over');
	$('#tab_item6').removeClass('over');
	$('#tab_item7').removeClass('over');
	
}

function showServiceTab(num) {
	hideServiceTabs();
	$('#tab' + num + '_content').fadeIn();
	$('#tab_item' + num).addClass('over');
	return false;
}



