﻿var isIEB = document.all ? true : false

// Mouse mouve		
if (!isIEB && window.Event && document.captureEvents) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = adjustImage

function adjustImage(e)
{	
    var photoObject = document.getElementById('hiddenPhoto');
    
	picWidth = photoObject.width;
    picHeight = photoObject.height;
    
    photoObject.style.left = (document.body.offsetWidth - picWidth) / 2 + 'px';
    photoObject.style.top = (document.body.offsetHeight - picHeight) / 2 + 'px';
    
	return true;
}

function showHiddenLayer(picWidth, picHeight, picSource)
{
    var photoObject = document.getElementById('hiddenPhoto');
    var hiddenLayer = document.getElementById('hiddenLayer');
    var mainLayer = document.getElementById('content');
        
    hiddenLayer.style.display = '';
            
    photoObject.src = picSource;

    /*
    photoObject.style.width = picWidth + 'px';
    photoObject.style.height = picHeight + 'px';
    
    photoObject.style.left = (document.body.offsetWidth - picWidth) / 2 + 'px';
    photoObject.style.top = (document.body.offsetHeight - picHeight) / 2 + 'px';
    */
    picWidth = photoObject.width;
    picHeight = photoObject.height;
    
    photoObject.style.left = (document.body.offsetWidth - picWidth) / 2 + 'px';
    photoObject.style.top = (document.body.offsetHeight - picHeight) / 2 + 'px';
    
    document.body.style.overflow = 'hidden';
    setOpacity(mainLayer, 4);
}
function hideHiddenLayer()
{
    var hiddenLayer = document.getElementById('hiddenLayer');
    var mainLayer = document.getElementById('content');
    
    hiddenLayer.style.display = 'none';
    document.body.style.overflow = 'auto';
    setOpacity(mainLayer, 10);    
}
function setOpacity(obj, value)
{
    obj.style.opacity = value / 10;
	obj.style.filter = 'alpha(opacity=' + value * 10 + ')';	
}

