var NS4 = (document.layers) ? 1 : 0;
var IE4 = (document.all) ? 1 : 0;
var DOM = (document.getElementById) ? 1 : 0;

function NSdMenu(mnum)
{
        var menuname = "Menu"+mnum;
        if (NS4) {
                document.layers[menuname].visibility = "show";
        }
}

function dMenu(mnum, m)
{
        var menuname = "Menu"+mnum;
        var bottomname = "Bottom"+mnum;

        if (m=="over") {
                if (NS4) {
                        document.layers[menuname].visibility = "show";
                } else if(DOM) {
                        document.getElementById(menuname).style.visibility = "visible";
                } else {
                        document.all[menuname].style.visibility = "visible";
                }

        } else if (m=="out") {
                if (NS4) {
                        document.layers[menuname].visibility = "hide";
                } else if(DOM) {
                        document.getElementById(menuname).style.visibility = "hidden";
                } else {
                        document.all[menuname].style.visibility = "hidden";
                }
        }
}





                if ( window.Photo ) {
                        var strActivePhotoId = 'id1';
                        var stcViewImageId = 'id22'
                        var arrPhotos = [

                                        new Photo('id1', '../i/img-1.jpg'),
                                        new Photo('id2', '../i/img-2.jpg'),
                                        new Photo('id3', '../i/img-3.jpg'),
                                        new Photo('id4', '../i/img-4.jpg'),
                                        new Photo('id5', '../i/img-5.jpg'),
                                        new Photo('id6', '../i/img-6.jpg'),
                                        new Photo('id7', '../i/img-7.jpg'),
                                        new Photo('id8', '../i/img-8.jpg')
                        ]
                        var arrThumbnailsActive = [

                                        new Photo('id1', '../i/tmb-1-a.jpg'),
                                        new Photo('id2', '../i/tmb-2-a.jpg'),
                                        new Photo('id3', '../i/tmb-3-a.jpg'),
                                        new Photo('id4', '../i/tmb-4-a.jpg'),
                                        new Photo('id5', '../i/tmb-5-a.jpg'),
                                        new Photo('id6', '../i/tmb-6-a.jpg'),
                                        new Photo('id7', '../i/tmb-7-a.jpg'),
                                        new Photo('id8', '../i/tmb-8-a.jpg')
                        ]
                        var arrThumbnailsNormal = [

                                        new Photo('id1', '../i/tmb-1-a.jpg'),
                                        new Photo('id2', '../i/tmb-2-a.jpg'),
                                        new Photo('id3', '../i/tmb-3-a.jpg'),
                                        new Photo('id4', '../i/tmb-4-a.jpg'),
                                        new Photo('id5', '../i/tmb-5-a.jpg'),
                                        new Photo('id6', '../i/tmb-6-a.jpg'),
                                        new Photo('id7', '../i/tmb-7-a.jpg'),
                                        new Photo('id8', '../i/tmb-8-a.jpg')
                        ]
                }

                function Photo( strPhotoId, strImageSrc ) {
        this.id = strPhotoId;
        this.imageSrc = strImageSrc;
}




function viewPhoto( strPhotoId ) {
        if ( strActivePhotoId != strPhotoId ) {
                strActivePhotoId = strPhotoId;
                for ( var i = 0; i < arrPhotos.length; i++ ) {
                        var objThumbnail = document.getElementById( arrPhotos[i].id );
                        var objTitle = document.getElementById( 'title' + arrPhotos[i].id );
                        if ( objThumbnail ) {
                                if ( arrPhotos[i].id == strPhotoId ) {
                                        if (objTitle) objTitle.className = 'active';
                                        objThumbnail.className = 'thumbnail active';
                                        if ( window.arrThumbnailsActive ) objThumbnail.firstChild.src = arrThumbnailsActive[i].imageSrc;

                                        var objViewImage = document.getElementById( stcViewImageId );
                                        if ( objViewImage ) objViewImage.src = arrPhotos[i].imageSrc;

                                } else {
                                        if (objTitle) objTitle.className = '';
                                        objThumbnail.className = 'thumbnail';
                                        if ( window.arrThumbnailsNormal ) objThumbnail.firstChild.src = arrThumbnailsNormal[i].imageSrc;
                                }
                        }
                }
        }
}
