var PageInfo = function(){};
PageInfo.getPageSizeWithScroll = function(){
if( typeof window.innerHeight == 'number' && typeof window.scrollMaxY == 'number' ){ 
pageWidth = window.innerWidth + window.scrollMaxX;
pageHeight = window.innerHeight + window.scrollMaxY;
}else if( document.body.scrollHeight > document.body.offsetHeight ){ 
pageWidth = document.body.scrollWidth;
pageHeight = document.body.scrollHeight;
}else{ 
pageWidth = document.body.offsetWidth + document.body.offsetLeft;
pageHeight = document.body.offsetHeight + document.body.offsetTop;
}
pageWidth = Math.max(pageWidth,document.documentElement.clientWidth);
pageWidth = Math.max(pageWidth,document.body.clientWidth);
pageHeight = Math.max(pageHeight,document.documentElement.clientHeight);
pageHeight = Math.max(pageHeight,document.body.clientHeight);
return new Array(pageWidth,pageHeight);
};
PageInfo.getViewPortSize = function(){
var xViewPort = self.innerWidth || (document.documentElement.clientWidth || document.body.clientWidth);
var yViewPort = self.innerHeight || (document.documentElement.clientHeight || document.body.clientHeight);
arrayViewPortSize = new Array(xViewPort,yViewPort);
return arrayViewPortSize;
};
PageInfo.getPageCornerCoord = function(){
var pageSizeWithScroll = PageInfo.getPageSizeWithScroll();
var xCornerCoord = pageSizeWithScroll[0] - pageSizeWithScroll[0] + document.body.scrollLeft + document.documentElement.scrollLeft;
var yCornerCoord = pageSizeWithScroll[1] - pageSizeWithScroll[1] + document.body.scrollTop + document.documentElement.scrollTop;
arrayPageCornerCoord = new Array(xCornerCoord,yCornerCoord);
return arrayPageCornerCoord;
};
function divPopUp(pElementId){
var state 	= document.getElementById('greyBox').style.display;
if(document.getElementById)	{
if (state == 'none') {
state = 'block';
}	else	{
state = 'none';
}
var pHeight = 407;
var pWidth = 634;
var wGreyBoxPadding = 50;
var top = (PageInfo.getPageCornerCoord()[1] + ((PageInfo.getViewPortSize()[1] - pHeight)/2));
top = Math.max(top,PageInfo.getPageCornerCoord()[1]);
document.getElementById(pElementId).style.left = (PageInfo.getPageCornerCoord()[0] + ((PageInfo.getViewPortSize()[0] - pWidth)/2))+'px';
document.getElementById(pElementId).style.top = top+'px';
document.getElementById(pElementId).style.display = state;
document.getElementById('greyBox').style.height = Math.max(PageInfo.getPageSizeWithScroll()[1],(PageInfo.getPageCornerCoord()[1]+pHeight+wGreyBoxPadding)) + 'px';
document.getElementById('greyBox').style.display = state;
}
}
