// JavaScript Document
function pageWidth() {return window.innerWidth != null? window.innerWidth: document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth:document.body != null? document.body.clientWidth:null;}
function pageHeight() {return window.innerHeight != null? window.innerHeight: document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight:document.body != null? document.body.clientHeight:null;}
function posLeft() {return typeof window.pageXOffset != 'undefined' ? window.pageXOffset:document.documentElement && document.documentElement.scrollLeft? document.documentElement.scrollLeft:document.body.scrollLeft? document.body.scrollLeft:0;}
function posTop() {return typeof window.pageYOffset != 'undefined' ? window.pageYOffset:document.documentElement && document.documentElement.scrollTop? document.documentElement.scrollTop: document.body.scrollTop?document.body.scrollTop:0;}
function posRight() {return posLeft()+pageWidth();}
function posBottom() {return posTop()+pageHeight();}
function getXCoord(el) {
	x=0;
	while(el){
		x+=el.offsetLeft;
		el=el.offsetParent;
	}
	return x;
}
function getYCoord(el) {
	y=0;
	while(el){
		y+=el.offsetTop;
		el=el.offsetParent;
	}
	return y;
}
function hidePage(hv)
{
var aEls= document.getElementsByTagName("*")
for (var iEl = 0; iEl < aEls.length; iEl++)
	{
aEls[iEl].style.visibility=hv;
	}
}
function dim_down()
{
/*
var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
*/

document.getElementById("dim_div").style.height=posBottom()+"px";//myHeight
document.getElementById("dim_div").style.width= posRight()+"px";;
document.getElementById("add_new_div").style.top=(posTop()+100)+"px";

}
function addNewFrame(fn)
{
var fin= '<iframe style="position:absolute; z-index:102" id="add_new" name="add_new" frameborder="0" width="100%" height="200px" src="'+ 'modules/'+fn+'.php"><\/iframe>';
document.getElementById("dim_div").style.visibility="visible";
document.getElementById("add_new_div").style.visibility="visible";
document.getElementById("add_new_div").innerHTML=fin;
dim_down();
}
function addNewPop(fin)
{
//var fin= '<iframe style="position:absolute; z-index:102" id="add_new" name="add_new" frameborder="0" width="100%" height="200px" src="'+ 'modules/'+fn+'.php"><\/iframe>';
document.getElementById("dim_div").style.visibility="visible";
document.getElementById("add_new_div").style.visibility="visible";
document.getElementById("add_new_div").innerHTML=fin;
dim_down();
}
function cancelNew(fn)
{
document.getElementById("dim_div").style.visibility="hidden";
document.getElementById("add_new_div").style.visibility="hidden";
document.getElementById("add_new_div").innerHTML="";
if(window.cancelNewExtra()) cancelNewExtra();
}