function getPosition() {
      var top    = document.documentElement.scrollTop;
      var left   = document.documentElement.scrollLeft;
      var height = document.documentElement.clientHeight;
      var width  = document.documentElement.clientWidth;
      return {top:top,left:left,height:height,width:width};
}

function showPop(width,height,leftOff,topOff){
    //nextSibling
	if(document.getElementById("pop").style.display == "block")
	{
		document.getElementById("pop").style.display = "none";
	}
	else
	{
	    var obj    = document.getElementById("pop");
    	
	    obj.style.display  = "block";
	    obj.style.position = "absolute";
	    obj.style.zindex   = "999";
	    obj.style.width    = width + "px";
	    //obj.style.height   = height + "px";
    	
	    var Position = getPosition();
	    leftadd = (Position.width-width)/2;
	    topadd  = (Position.height-height)/2;
	    //topadd  = 0;//Position.height/2;
	    obj.style.top  = (Position.top  + topadd + topOff)  + "px";
	    obj.style.left = (Position.left + leftadd + leftOff) + "px";
    	
	    window.onscroll = function (){
		    var Position   = getPosition();
		    obj.style.top  = (Position.top  + topadd)  +"px";
		    obj.style.left = (Position.left + leftadd) +"px";
	    };
	}
}

function hidePop(){
	document.getElementById("pop").style.display = "none";
}