var Y=3000
function GetEl(i) {
  return document.getElementById(i)
}

function GetX(el) {
  var x=0
  while (el) {
    x += el.offsetLeft
    el = el.offsetParent
  }
  return x
}

function GetY(el) {
  var y=0
  while (el) {
    y += el.offsetTop
    el = el.offsetParent
  }
  return y
}

function GetWinHeight() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
  return myHeight
}

function Show(el){
  var e=GetEl('OP')
  e.style.left=''+(Math.max(GetX(el),850)-800)+'px'
  Y=GetY(el)
  scrollTo(0,Y-20)
  e.style.top=''+(Y+20)+'px'
  GetEl('inner').style.height=''+(GetWinHeight()-130)+'px'
  e.className=''
}

function X(){
  GetEl('OP').className='hide'
  scrollTo(0,Y-20)
}
