// JavaScript Document
function getScrollY() 
{
    scrollY = 0;    
    if (typeof window.pageYOffset == "number") {
        scrollY = window.pageYOffset;
    } else if (document.documentElement && document.documentElement.scrollTop) {
        scrollY = document.documentElement.scrollTop;
    }  else if (document.body && document.body.scrollTop) {
        scrollY = document.body.scrollTop; 
    } else if (window.scrollY) {
        scrollY = window.scrollY;
    }
    return scrollY;
}
  
function getInnerHeight() 
{
    height = 0;
    if (window.innerHeight) {
        height = window.innerHeight - 18;
    } else if (document.documentElement && document.documentElement.clientHeight) {
        height = document.documentElement.clientHeight;
    } else if (document.body && document.body.clientHeight) {
        height = document.body.clientHeight;
    }
    return height;
}



function getXmlHttp(){
  var xmlhttp;
  try {
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
    try {
      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (E) {
      xmlhttp = false;
    }
  }
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    xmlhttp = new XMLHttpRequest();
  }
  return xmlhttp;
}

function getText(source) {
  var xmlhttp = getXmlHttp();
  xmlhttp.open('GET', source, false);
  xmlhttp.send(null);
  if(xmlhttp.status == 200) {
    return xmlhttp.responseText; 
  }
}
  
  function showPopUp(source, name) {
	 // 
  var main = window.top.document.body.appendChild(document.createElement("div"));
   main.style.backgroundColor="#000000";
    main.style.position="absolute";
    main.style.top=document.body.offsetTop;
    main.style.left=document.body.offsetLeft;
    main.style.height=document.body.offsetHeight;
    main.style.width=document.body.offsetWidth;
	main.style.opacity="0.50;"
	main.style.filter="alpha(opacity=50)";
    main.style.zIndex="1";/**/

main.setAttribute("style", "position:absolute;  top:0px; left:0px; width:100%; height:100%; background-color:#000000; z-index:1; opacity:0.50; filter:alpha(opacity=50); -moz-opacity:0.5;");

	main.setAttribute("id","backDiv_"+name);

    div = document.body.appendChild(document.createElement("div"));
	div.innerHTML = typeof(source)=="string" ? getText(source) : source.innerHTML;
	div.setAttribute("id","popUp_"+name);
	div.style.left = parseInt((screen.width/2)-(150))+"px";
	div.style.top = getScrollY() - parseInt((screen.height/2)-(150))+"px";
    /*div.style.top=parseInt((document.body.clientHeight-div.firstChild.offsetHeight)/2)-500+"px";
    div.style.left=parseInt((document.body.clientWidth-div.firstChild.offsetWidth)/2)+"px";*/
    div.style.position="absolute";
    div.style.zIndex="10";

    return main; /* */
  }
  

  function hidePopUp(name) {
    document.getElementById("backDiv_"+name).parentNode.removeChild(document.getElementById("backDiv_"+name));
    document.getElementById("popUp_"+name).parentNode.removeChild(document.getElementById("popUp_"+name));
  }  

