var ns4 = (document.layers)? true:false;
var ns6 = (document.getElementById)? true:false;
var ie4 = (document.all)? true:false;
var ie5 = false; 

if (ie4) { 
	if ((navigator.userAgent.indexOf('MSIE 5') > 0) || (navigator.userAgent.indexOf('MSIE 6') > 0)) { ie5 = true; }
	if (ns6) { ns6 = false; }
}

function openPopup(page,pWidth,pHeight,pTool){
// get browser width and height if nothing is sent in the function...
	if(pWidth=='z'){
	
				if(ie4){pWidth = document.body.clientWidth;pHeight = document.body.clientWidth}
					else if(ns4){pWidth = window.innerWidth;pHeight = window.innerHeight;}
					else if(ns6){pWidth = window.innerWidth;pHeight = window.innerHeight;}
				}
    var winStats="menubar="+pTool+",location="+pTool+",directories="+pTool+",status="+pTool+",resizable="+pTool+",scrollbars=yes";
    if(ie4){
      winStats+=",left=50,top=50,width="+pWidth+",height="+pHeight;
    }
    else
    {
      winStats+=",screenX=50,screenY=50,width="+pWidth+",height="+pHeight;
    }
	
	var popwin=window.open(page, "popupwin",winStats);
}