triggerArray = new Array ( 0 ) ;

collectTriggers = function ( objects ) {
    triggerArray.push ( objects ) ;
} ;

initRollovers = function ( elements ) {
    for ( var i = 0 ; i < elements.length ; i++ ) {
        if ( elements[ i ] != '' )
            $( "#" + elements[ i ].toLowerCase () + " a" ).addClass( 'active' ) ;
    }
} ;

$( document ).ready ( function () {
    var pCounter = 1 ;

    $( "a" ).focus ( function () {
        this.blur () ;
    } ) ;

    $( ".navigation a" ).each ( function () {
        if ( $( this ).parent().attr ( 'id' ) == null ) {
            $( this ).parent().attr ( 'id' , $( this ).text().toLowerCase() ) ;
        }
    } ) ;

    $( "input" ).each ( function () {
        $( this ).addClass ( $( this ).attr( 'type' ) ) ;
    } ) ;

    $( "table.rollover tr" ).each ( function () {
        $( this ).addClass( ( ( pCounter++ % 2 ) == 0 ) ? 'secondRow' : '' ).hover(
            function () { $( this ).addClass ( 'hover' ) } ,
            function () { $( this ).removeClass ( 'hover' ) }
        ).click ( function () { $( this ).toggleClass ( 'highlight' ) } ) ;
    } ) ;

    for ( var i = 0 ; i < triggerArray.length ; i++ ) {
        eval ( triggerArray [ i ] ) ;
    }
} ) ;
