﻿function closeZoomWindow()
{
    document.getElementById('light').style.display='none';
    document.getElementById('fade').style.display='none';
}
function showDetailImage(url,imgheight,imgwidth)
{
 
 document.getElementById('light').style.display='block';
 document.getElementById('fade').style.display='block'   
  document.getElementById('imageZoomImg').src=url;
  document.getElementById('imageZoomImg').width=imgwidth;
  document.getElementById('imageZoomImg').height=imgheight;
  document.getElementById('light').style.width=imgwidth+20;
  document.getElementById('light').style.height=imgheight+37;
  document.getElementById('fade').style.left=0;
  document.getElementById('fade').style.top=0;
    setWidthAndHeight();
  
  document.getElementById('btnClose1').style.width=imgwidth+20;
    
    
}

function getWindowHeight()
{
 var functionReturn = 0;

 if ( (document.documentElement) && (document.documentElement.clientHeight) )
  functionReturn = document.documentElement.clientHeight;
 else if ( (document.body) && (document.body.clientHeight) )
  functionReturn = document.body.clientHeight;
 else if ( (document.body) && (document.body.offsetHeight) )
  functionReturn = document.body.offsetHeight;
 else if ( window.innerHeight )
  functionReturn = window.innerHeight - 18;

 functionReturn = parseInt(functionReturn);
 if ( (isNaN(functionReturn) == true) || (functionReturn < 0) )
  functionReturn = 0;

 return functionReturn;
};



function getWindowWidth()
{
 var functionReturn = 0;

 if ( (document.documentElement) && (document.documentElement.clientWidth) )
  functionReturn = document.documentElement.clientWidth;
 else if ( (document.body) && (document.body.clientWidth) )
  functionReturn = document.body.clientWidth;
 else if ( (document.body) && (document.body.offsetWidth) )
  functionReturn = document.body.offsetWidth;
 else if ( window.innerWidth )
  functionReturn = window.innerWidth - 18;

 functionReturn = parseInt(functionReturn);
 if ( (isNaN(functionReturn) == true) || (functionReturn < 0) )
  functionReturn = 0;

 return functionReturn;
};

function setWidthAndHeight()
{
    document.getElementById('fade').style.height=getWindowHeight();
    document.getElementById('fade').style.width=getWindowWidth();

}

window.onresize=setWidthAndHeight;