
var tabSet = new tabSetParent();

// ------------------------
// Browser / OS Detection -
// ------------------------
var IE = (document.all) ? 1 : 0;
var DOM = (document.getElementById) ? 1 : 0;
var NS4 = (document.layers) ? 1 : 0;
var MAC = ((navigator.appVersion.indexOf("PPC") >0) || (navigator.appVersion.indexOf("Mac") >0)) ? 1 : 0;

var ua = navigator.userAgent;
var OPERA = (ua.indexOf("Opera") > 0) ? 1 : 0;
var SAF = (navigator.appVersion.indexOf("Safari") >0) ? 1 : 0;

if (ua.indexOf("AOL") > 0) {
	var s_prop9="AOL"; // for Omniture
	var dclk_seg="aol"; // for Doubleclick
    }


function getEl(el) {
    return document.all ? document.all[el] : document.getElementById(el);
    }




// --------------------------------------------------------------------------
// AJAX and other scripts for the tab-sets  -
// --------------------------------------------------------------------------

function getHTTPObject() {
	var xmlhttp;
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		 try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		 } catch (E) {
				xmlhttp = false;
		 }
	}

	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
		} catch (e) {
			xmlhttp = false;
		}
	}

	return xmlhttp;
}



<!-- scripts-tab -->
function tabSetParent(){
    this.newSet = function( name ){
        eval( 'this.' + name + '= new tabSetObj("'+ name +'");' );
    }
}

function tabSetObj( name ){

    if(IE && MAC){return;}
    
    this.name = name;
    this.spacer = '<img src="http://moritzlaw.osu.edu/images/spacer.gif" width="1" height="1">';
	this.preTabCell  = function(){return ''}
	this.postTabCell = function(){return ''}
	this.preTabFoot  = function(){return ''}
	this.postTabFoot = function(){return ''}
    this.addId        = function(){return ''}
    this.addMouseOver = function(){return ''}
    this.addMouseOut  = function(){return ''}

    this.arrayPush = function( array, value ){
        array[array.length] = value;
        return;
    }
	
    // addTab to TabSet
    this.addTab = function( label, url, row, def ){
        if( row == null ) row = 0;
        this.row = new Array();
		
        if( def ) this.defaultRow = row;

        if( this.label ){
            if( this.label[row] )
            {                    
                this.arrayPush( this.label[row], label )
                this.arrayPush( this.url[row], url );
            }else{                                    
                this.label[row] = Array( label );
                this.url[row] = Array( url );
            }
        }else{
            this.label = new Array();
            this.label[row] = Array( label );
            this.url = new Array();
            this.url[row] = Array( url );
        }
        this.row[row] = true;
        if( def ) this.defaultCell = this.label[row].length - 1;

    }

     this.getClassName = function(){
        return (( this.defaultRow == row ) && ( this.defaultCell == cell )) ? this.classOn : this.classOff ;
    }
    
    this.drawTabSet = function( dRow, dCell ){
        if( dRow != null ) this.defaultRow = dRow;
        if( dCell != null ) this.defaultCell = dCell;

        var tabSetHtml = '';
        // For Each Row
        for( row=this.row.length-1; row>=0; row-- ){
            rowHtml = '';
            label = this.label[row]
            rowHtml+= '<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>';
            
			if( this.tabVSpace ){
				rowHtml+= '<td height="'+ this.tabVSpace +'"></td></tr><tr>';
			}
						
			// For each Tab in a Specified row
            for( cell=0; cell < label.length; cell++ ){
                className = this.getClassName(cell);
                mouseOver = this.addMouseOver(cell,className);
                mouseOut = this.addMouseOut(cell,className);
                addId = this.addId(cell);
                rowHtml += this.preTabCell();
				rowHtml += '<td';
                rowHtml += ' class="'+ className +'"';
                rowHtml += ' onclick="javascript:tabSet.' + this.name + ".click(" + row + "," + cell + ')"';
                //rowHtml += ' title="Row('+ row +') Cell('+ cell +')"';
                rowHtml += addId + mouseOver + mouseOut;
                rowHtml += '>';
                // rowHtml += '<a style="text-decoration:none;" href="javascript:tabSet.' + this.name + ".click(" + row + "," + cell + ')">';
                rowHtml += label[cell];
                // rowHtml += '</a>';
                rowHtml += '</td>';
				rowHtml += this.postTabCell();
                if( this.tabHSpace ) rowHtml += '<td width="'+ this.tabHSpace +'">' + this.spacer + '</td>';
            }
            rowHtml+= '</tr>';
			rowHtml+= "\n\n\n";
			
            // Footer Row
		    if( this.defaultRow == row && this.footer != false){
                rowHtml += '<tr>';
                for( cell=0; cell < label.length; cell++ ){
                    className = (( this.defaultRow == row ) && ( this.defaultCell == cell )) ? this.footClassOn : this.footClassOff ;
                    rowHtml += this.preTabFoot();
					rowHtml += '<td';
                    rowHtml += ' class="'+ className +'"';
                    rowHtml += '>';
                    rowHtml += this.spacer;
                    rowHtml += '</td>';
					rowHtml += this.postTabFoot();
                    if( this.tabHSpace ) rowHtml += '<td width="'+ this.tabHSpace +'" class="' + this.hSpace + '">' + this.spacer + '</td>';
                }
                rowHtml += '</tr>';
            }        
            rowHtml+= '</table>';
            if( this.defaultRow == row ){
                bottomRow = rowHtml;
            }else{
                tabSetHtml += rowHtml;
            }

        }
        document.getElementById(this.tabDivName).innerHTML = tabSetHtml + bottomRow;
    }

    this.renderTabs = function( dRow, dCell ){

		this.tabDivName = 'tabSet-tab-'+ this.name;
        var div = '<div id="'+ this.tabDivName +'">.</div>';
        document.write( div );

        this.drawTabSet();

    }

    this.click = function( row, cell ){
		this.changeContents( this.url[row][cell] );
        this.drawTabSet( row, cell );
    }

    this.changeContents= function( url ){
        http = getHTTPObject();
        http.open( "GET", url, true);
        http.onreadystatechange = this.onreadystatechange;
        tabSet.tabDestination = this.name;
        http.send(null);
    }        

    this.onreadystatechange = function(){
        if (http.readyState == 4) {
            eval( "document.getElementById('tabSet_" + tabSet.tabDestination + "_div').innerHTML = http.responseText;" );
        }
    }

}

