﻿//<SCRIPT>
//*****************************************************************************************/
//  File:       traffic_common.js.js
//  Author:     Håvard Meling, Bouvet AS
//  Created:    9 Feb. 2007 
//  Comment:    Contains common javascript blocks used throughout the application
//  Note:       
//*****************************************************************************************/

//*****************************************************************************************/
// Function:    ToggleEditorDisplay
// Description: This code block is used by TrafficCollapsibleEditorZone to expand minimize editors
// for webparts
// Note: This code is required by all webpart pages      
function ToggleEditorDisplay( divClientID, imgClientUrl, expandImageUrl, minimizeImageUrl ) {

    var el = document.getElementById(divClientID) ;
    if( el.style.display=='none' ) {
        el.style.display='';
        document.images[imgClientUrl].src= minimizeImageUrl;
    } else {
        el.style.display='none';
        document.images[imgClientUrl].src= expandImageUrl;
    }
}

//*****************************************************************************************/
// Function:    AddExtraPluginSupport
// Description: This code can be used to deal with activate plugins problems in current
// browsers. See http://en.wikipedia.org/wiki/Eolas. This code must be run after all "objects" has been
// inserted. (Or the ones that need this support)
// Note: Another solution is to use AC_RunActiveContent.js in /common/javascript.     
function AddExtraPluginSupport() 
{
    theObjects = document.getElementsByTagName("object");
    for (var i = 0; i < theObjects.length; i++) {
        theObjects[i].outerHTML = theObjects[i].outerHTML;
    }
}

