
function switchTabs(newTab)
{
	$(newTab).blur();
	
	if ($(newTab).parent().hasClass('notselected')) {
		var _i = 1;
		$('div#instPopUp a.switchTab').each(function() { 
			if ($(this).parent().hasClass('notselected')) {
				$(this).parent().removeClass('notselected');
				$('div#instPopUp table tr td.popContent div#page_'+_i).show();
			} else {
				$(this).parent().addClass('notselected');
				$('div#instPopUp table tr td.popContent div#page_'+_i).hide();
			}
			_i ++;
		});
	}
	
	return false;
}

$(document).ready(function(){

    $('div#instPopUp').hide();
    
    $('a.instPages').click(function() {
    	var _id = $(this).attr('id');
    		_id = _id.split('_');
    		_id = _id[1];
    	var _inst = $(this).html();
    	
    	$.get("?module=Class&event=Instructor&classID="+$('input#programID').val()+"&instructorID="+_id, {}, 
			function(data){
				var _data = data.split('|');
				if (_data[0] != '200') {
					_data[0] = '';
					alert(_data.join(''));
					
				} else {
					$('div#instPopUp table tr th.popInstructor').html('<span id="x" onClick="$(\'div#instPopUp\').hide();">X</span>'+_inst);
					$('div#instPopUp table tr td.popContent').html(String(data).substr(4));
					$('div#instPopUp table tr td.popContent div#page_2').hide();
					$('div#instPopUp').fadeIn('slow');
				}
			}
		);

    	return false;	
    });
    
});
