<!--

var bFixIEPopup = navigator.appName.indexOf('Microsoft') != -1 && (navigator.appVersion.indexOf('MSIE 5') != -1 || navigator.appVersion.indexOf('MSIE 6') != -1);

iframeObj = null;   

function resizeFixMSIE(divId)
{
    if(bFixIEPopup && document.getElementById(divId))
    {   
        var pPopup = document.getElementById(divId);
        var iframeObj = document.createElement('IFRAME');
		
		iframeObj.id = divId + 'FixMSIE';
		iframeObj.style.position = 'absolute';
		iframeObj.style.display = 'none';
		iframeObj.style.zIndex = 1;
		iframeObj.border = '0px';
		iframeObj.src = 'about:blank';
		iframeObj.style.border = '0px';   
		document.body.appendChild(iframeObj);       
		     
		iframeObj.style.left = parseInt(pPopup.style.left) + 2;       
        iframeObj.style.top =  parseInt(pPopup.style.top) + 2;
            
	    iframeObj.style.width = (pPopup.offsetWidth - 4) + 'px'; 
	    iframeObj.style.height = (pPopup.offsetHeight - 4) + 'px' ;	 
        
        iframeObj.style.display = 'block';
        
        iframeObj.style.zIndex = 1;
        pPopup.style.zIndex = 2;      
    }
}

function hideFixMSIE(divId)
{
	if(bFixIEPopup && document.getElementById(divId + 'FixMSIE'))
    {
		document.body.removeChild(document.getElementById(divId + 'FixMSIE'));
	}	
}

/**
 * Get Object By ID
 *
 */
function getObject(objectId) 
{
  if(document.getElementById && document.getElementById(objectId)) 
  {
    return document.getElementById(objectId);
  } 
  else if (document.all && document.all(objectId)) 
  {
    return document.all(objectId);
  } 
  else if (document.layers && document.layers[objectId]) 
  {
    return getObjNN4(document,objectId);
  } 
  else 
  {
    return false;
  }
} 

function getScrollY() 
{
    var scrOfY = 0;
    if( typeof( window.pageYOffset ) == 'number' ) 
    {
        // Netscape compliant
        scrOfY = window.pageYOffset;
    } 
    else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) 
    {
        // DOM compliant
        scrOfY = document.body.scrollTop;
    } 
    else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) 
    {
        // IE6 standards compliant mode
        scrOfY = document.documentElement.scrollTop;
    }
    return scrOfY;
}

function getScrollX() 
{
    var scrOfX = 0;
    if( typeof( window.pageYOffset ) == 'number' ) 
    {
        // Netscape compliant
        scrOfX = window.pageXOffset;
    } 
    else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) 
    {
        // DOM compliant
        scrOfX = document.body.scrollLeft;
    } 
    else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) 
    {
        // IE6 standards compliant mode
        scrOfX = document.documentElement.scrollLeft;
    }
    return scrOfX;
}

function getFrameWidth()
{
    var frameWidth = 0;
    if (self.innerWidth)
    {
        frameWidth = self.innerWidth;
    }
    else if (document.documentElement && document.documentElement.clientWidth)
    {
        frameWidth = document.documentElement.clientWidth;
    }
    else if (document.body)
    {
        frameWidth = document.body.clientWidth;
    }
    return frameWidth;
}

function getFrameHeight()
{
    var frameHeight = 0;
    if (self.innerHeight)
    {
        frameHeight = self.innerHeight;
    }
    else if (document.documentElement && document.documentElement.clientHeight)
    {
        frameHeight = document.documentElement.clientHeight;
    }
    else if (document.body)
    {
        frameHeight = document.body.clientHeight;
    }
    return frameHeight;
}

function getDocWidth() 
{
    return Math.max(
        Math.max(document.body.scrollWidth, document.documentElement.scrollWidth),
        Math.max(document.body.offsetWidth, document.documentElement.offsetWidth),
        Math.max(document.body.clientWidth, document.documentElement.clientWidth)
    );
}

function getDocHeight() 
{
    return Math.max(
        Math.max(document.body.scrollHeight, document.documentElement.scrollHeight),
        Math.max(document.body.offsetHeight, document.documentElement.offsetHeight),
        Math.max(document.body.clientHeight, document.documentElement.clientHeight)
    );
}

function setOpacity(pObject, nValue) 
{
    pObject.style.opacity = nValue/10;
    pObject.style.filter = 'alpha(opacity=' + nValue*10 + ')';
}



function ShowImageGallery(strImageSrc) 
{    
    ClosePopupFrame();
    
    pPopupBG = document.createElement('DIV');      
    pPopupBG.id = 'PopupBG';  
    pPopupBG.className = 'popupbg';                          
    pPopupBG.style.width = getDocWidth() + 'px';
    pPopupBG.style.height = getDocHeight() + 'px';
    setOpacity(pPopupBG, 3);
    pPopupBG.onclick = ClosePopupFrame;
    
    pPopupBG.innerHTML = '&nbsp'; 
                                
    document.body.appendChild(pPopupBG);

    pPopupFrame = document.createElement('DIV');    
    pPopupFrame.id = 'GallerPopupFrame';
    pPopupFrame.className = 'popupgallery'; 
    
    pPopupFrame.innerHTML = '<img src="' + strImageSrc + '" onload="OnImageLoad(this)" style="padding:2px;" />';        

    document.body.appendChild(pPopupFrame); 
}

function ClosePopupFrame() 
{ 
    if(document.getElementById('PopupBG'))
    {            
        hideFixMSIE('GallerPopupFrame');
		document.body.removeChild(document.getElementById('PopupBG'));
        document.body.removeChild(document.getElementById('GallerPopupFrame'));   
		
    } 
}

function OnImageLoad(pImage)
{                                           
    var pPopupFrame = getObject("GallerPopupFrame");
    if (pPopupFrame)
    {
        var x = (getFrameWidth() / 2) - (pImage.width / 2) + getScrollX();
        var y = (getFrameHeight() / 2) - (pImage.height / 2) + getScrollY();  
                  
        pPopupFrame.style.top = y + 'px';
        pPopupFrame.style.left = x + 'px';
        
        pPopupFrame.style.visibility = "visible";
    
        resizeFixMSIE('GallerPopupFrame');
    }         
} 

// -->