//--------------------------------------------------------------------
// Name: popup()
// Desc: Pops up a new window according to the parameters passed in.
//--------------------------------------------------------------------
function popup( url, name, width, height )
{

    window.open( url, name, "location=1,status=1,scrollbars=1,width=" + width + ",height=" + height );
    
}


//--------------------------------------------------------------------
// Name: addImageRollovers()
// Desc: An array of IDs of images is passed in and it adds rollovers
//       to each one.
//--------------------------------------------------------------------
function addImageRollovers( id_array )
{

    // Get the image's elements.
    var image_info = new Array();
    for ( var i = 0; i < id_array.length; i++ )
    {
        
        var element = document.getElementById( id_array[i] );
        
        image_info[i] = { element: element, 
                          filename: element.src.substring( 0, element.src.length - 4 ), 
                          file_extension: element.src.substring( element.src.length - 3 ) };
        
    }  // Next image.
    
    // Preload the images.
    var image_object = new Image();
    for ( var i = 0; i < id_array.length; i++ )
    {
    
        image_object.src = image_info[i].filename + "."  + image_info[i].file_extension;
    
    }  // Next image.
    
    // Add the image events.
    for ( var i = 0; i < id_array.length; i++ )
    {
            
        image_info[i].element.onmouseover = new Function( "document.getElementById( '" + id_array[i] + "' ).src = '" + image_info[i].filename + "-hover." + image_info[i].file_extension + "';" );
        image_info[i].element.onmouseout = new Function( "document.getElementById( '" + id_array[i] + "' ).src = '" + image_info[i].filename + "." + image_info[i].file_extension + "';" );
        
    }  // Next image.
    
}
