/********************
* js/instructor.js
*------------------
* javascript for display of instructor info
*------------------
* 1.00 (cheth) 2010-Jul-19 initial implementation.
*********************/

/**************
* jQuery stuff
**************/
$(function() {
    // -----the five tabs: directory/recent/pop/tips/bio--------
    $('.tabset li').click(function(){ 
        display_tab(this);
        return false;  // prevents <a href . . .> link from jumping around page
    });
    // -----style/difficulty/category filters--------
    $('.selection select').change(function(){
        $(this).closest("form").submit();
    });
});

/*********************
* function: display_tab()
*  purpose: display selected tabbed div (hiding other tabbed divs)
*   params: <object> selected LI element (tab)
*  returns: null
*********************/
function display_tab(x) {
	var myDestination = $(x).find('a').attr('href');
	var myDestinationDigit = myDestination.charAt(myDestination.length-1);
	for (i=1;i<6;i++) {
	    if (i==myDestinationDigit) {
	        $('#tabset-' + i).addClass("active");
	        $('#tab-' + i).css('display','block');
	    } else {
	        $('#tabset-' + i).removeClass("active");
	        $('#tab-' + i).css('display','none');
		};	    
	};    
};    


