var wndhnd

function Help(page)
{
  CloseWin();
  wndhnd = window.open("ASPX2ASP.aspx?ASP=Help&page=" + page,"Help","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,titlebar=no,resizable=yes,copyhistory=no,top=20,left=20,width=660,height=550");
   wndhnd.focus();
}

function OpenWindow(x,y,z,intWidth,intHeight)
{
    CloseWin();
   
    if(typeof(z)=="undefined"){
	    z="";
    }
    if(typeof(intWidth)=="undefined" || typeof(intHeight)=="undefined"){
        intWidth = 0;
        intHeight = 0;
    }
    if(z==""){
        if(intWidth > 50 && intHeight > 50 ){
            if(intWidth > screen.width-20){  intWidth = screen.width-20;}
            if(intHeight > screen.height-20 ){intHeight = screen.height-20 ;}
            z = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,top=10,left=10,width=" + intWidth + ",height=" + intHeight; 
        }
        else{
            z = "directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,top=20,left=20,width=600,height=600";
        }
    }else{
        if(z=="Max"){
	        width = screen.width - 40;
	        height = screen.height - 70;
	        z = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,top=10,left=10,width=" + width + ",height=" + height; }
        if(z=="Max1"){
	        width = screen.width - 60;
	        height = screen.height - 90;
	        z = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,top=30,left=30,width=" + width + ",height=" + height; }
        if(z=="Max2"){
	        width = screen.width-30;
	        height = screen.height-60;
	        z = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,top=0,left=0,width=" + width + ",height=" + height; }
	}
    wndhnd = window.open(x,y,z);
    if(wndhnd != null)
    {
        wndhnd.focus() 
    }
}

function CloseWin(){
  if(typeof(wndhnd)=="object")
  {
    if(wndhnd != null)
    {
        if(wndhnd.closed==false)
        {
          wndhnd.close();
        }
    }
  }
}

