var debug=1;
var op=new Array();
var t_op=new Array();
var t_renew;

function getScreenWidth()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}

function getScreenHeight()
{
  return parseInt(screen.height)//document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
}

function tID(id)
{
 return(document.getElementById(id))
}

function setFullDivSize(id)
{
  tID(id).style.width=Math.floor(parseInt(getScreenWidth())*1.1)+'px'
  tID(id).style.height=parseInt(getScreenHeight())+'px'
}

function posRenew()
{
  tID("opacitylayer").style.top=parseInt(document.documentElement.scrollTop)+'px'//(Math.floor((parseInt(getScreenWidth())-parseInt(tID("opacitylayer").style.height))/2))+'px'
  tID("popupwindow").style.top=(parseInt(document.documentElement.scrollTop)+Math.floor(((parseInt(getScreenHeight())-parseInt(tID("popupwindow").style.height))/2)*0.5))+'px'
}

function showPopup(w,h)
{
  p=tID("opacitylayer")
  q=tID("popupwindow")
  setFullDivSize("opacitylayer")
  p.style.display="inline-block"
  theSetOpac(p,0.5)
  q.style.width=w+'px'
  q.style.height=h+'px'
  l=(Math.floor((parseInt(getScreenWidth())-parseInt(q.style.width))*1.05/2))+'px'
  t=(Math.floor(((parseInt(getScreenWidth())-parseInt(q.style.height))/2)*0.5))+'px'
  q.style.left=l
  q.style.top=t
  q.style.display="inline-block"
  theSetOpac(q,1.0)
  t_renew=setInterval('posRenew()',100)
}

function hidePopup()
{
  p=tID("opacitylayer")
  q=tID("popupwindow")
  theSetOpac(q,0)
  theSetOpac(p,0)
  p.style.display="none"
  q.style.display="none"
  clearInterval(t_renew)
}

function getOpac(obj) {
	    var result = window.getComputedStyle ? window.getComputedStyle(obj, null).opacity : null;
	    if(!+"\v1")   
	        result = obj.filters.alpha ? (obj.filters.alpha.opacity / 100) : 1;        
	     
	    return result;
	}

function theSetOpac(pppp,c)
{
 pppp.style.opacity = c;
 pppp.style.filter='alpha(opacity='+c*100+')';
}

