
function oppen()

	{
	document.getElementById('picture-layer').style.display='block'; 
	}


function close()
{
	document.getElementById('picture-layer').style.display='none';
}


//=============================================================================
var isDOM = document.getElementById;
var isLayers = document.layers;

var isAgent = navigator.userAgent.toLowerCase();

// version
var isMajor = parseInt( navigator.appVersion );
var isMinor = parseFloat( navigator.appVersion );

// detect opera
var isOpera = isAgent.indexOf( "opera" ) != -1 || window.opera;

// detect internet explorer
var isIE     = isAgent.indexOf( "msie" ) != -1 && !isOpera;
/*
var isIE3    = isIE && isMajor < 4;
var isIE4    = isIE && isMajor == 4 && isAgent.indexOf( "msie 4" ) != -1;
var isIE4up  = isIE && isMajor >= 4;
var isIE5    = isIE && isMajor == 4 && isAgent.indexOf( "msie 5.0" ) != -1;
var isIE5up  = isIE && !isIE3 && !isIE4;
var isIE55   = isIE && isMajor == 4 && isAgent.indexOf( "msie 5.5" ) != -1;
var isIE55up = isIE && !isIE3 && !isIE4 && !isIE5;
var isIE6    = isIE && isMajor == 4 && isAgent.indexOf( "msie 6." ) != -1;
var isIE6up  = isIE && !isIE3 && !isIE4 && !isIE5 && !isIE55;
*/

// is mozilla based ?
var isMozillaBased = isAgent.indexOf( "mozilla" ) != -1 && !( isOpera || isIE );

// detect netscape
var isNS = isAgent.indexOf( "netscape" ) != -1 || ( isLayers && !isOpera );

// detect firefox
var isFirefox = isAgent.indexOf( "firefox" ) != -1;

// detect mozilla
var isMozilla = isMozillaBased && !(isNS || isFirefox);

// features
var isGecko = isAgent.indexOf( "gecko" ) != -1;
var isDHTML = false;

//=============================================================================
//  get element
//=============================================================================

//
//  searches layer in NS4
//
function nsGetElement( layers, id )
{
    var element = layers[id];
    if( typeof element == "object" )
    {
        return element;
    }

    for( var i = 0; i < layers.length; i++ )
    {
        element = nsGetElement( layers[i].document.layers, id );
        if( typeof element == "object" )
        {
            return element;
        }
    }

    return void( 0 );
}

function getElement( id )
{
    var element = void( 0 );

    if( isDOM )
    {
        element = document.getElementById( id );
    }

    else if( isNS && isLayers )
    {
        element = nsGetElement( document.layers, id );
    }

    return (typeof element == "object") ? element : void( 0 );
}

//=============================================================================
//  attributes
//=============================================================================

//
//  get attribute
//
function getAttr( id, attr )
{
    var obj = getElement( id );
    if( typeof obj == "object" )
    {
        if( obj.style )
        {
            return obj.style[attr];
        }

        if( obj.getAttribute )
        {
            return obj.getAttribute( attr );
        }

        if( isNS )
        {
            return obj[attr];
        }
    }
    return void( 0 );
}

function setStyle( id, style, value )
{
    var obj = getElement( id );
    if( typeof obj == "object" )
    {
        if( obj.style )
        {
            if( obj.style.setAttribute )
            {
                obj.style.setAttribute( style, value );
            }
            else
            {
                obj.style[style] = value;
            }
        }

        else if( isNS )
        {
            obj[style] = value;
        }
    }
}

//=============================================================================
//  objects
//=============================================================================

function showObject( id )
{
    setStyle( id, "visibility", "visible" );
}

function hideObject( id )
{
    setStyle( id, "visibility", "hidden" );
}

//=============================================================================
//  images
//=============================================================================

function nsFinder( idx )
{
    this.idx = idx;
}

function nsFindImage( container, finder )
{
    if( container.images )
    {
        for( var i = 0; i < container.images.length; i++, finder.idx-- )
        {
            if( finder.idx == 0 )
            {
                delete finder;
                return container.images[i];
            }
        }
    }

    for( var j = 0; j < container.layers.length; j++ )
    {
        img = nsFindImage( container.layers[j].document, finder );
        if( typeof img == "object" )
        {
            return img;
        }
    }

    return void( 0 );
}

//
//  set a new image source
//
//  @param  idx  the index of image (assumed all images in a flat list like IE's document.images )
//  @param  src  the new source for the image
//
function swapImage( idx, src )
{
    if( document.images )
    {
        var img = isLayers ? nsFindImage( document, new nsFinder(idx) ) : document.images[idx];
        if( typeof img == "object" )
        {
            img.src = src;
        }
    }
}

//  
