// Script used for popup windows
  var x = 0; 

  function openNew(txt)
    {
      if (txt != ' ')
	  {
		//windowprops = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=640,height=480';
	    //windowprops = ''
		var winl = (screen.width - 700) / 2;
  		var wint = (screen.height - 480) / 2;
		windowprops = 'toolbar=yes,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=700,height=480,top=' + wint + ',left=' + winl;
	    
	  }
	  if (x != 0)
	  {
		window1.close();
	  }
	
	  window1=window.open(txt,"my_new_window",windowprops);
	  window1.focus();

	  //windowWidth=640;
	  //windowHeight=495;
	  //if (parseInt(navigator.appVersion) >= 4) 
		//window1.moveTo((screen.width/2)-(windowWidth/2+10),(screen.height/2)-(windowHeight/2+20));

	  x = 1;
	  return;	 
    }
	
	function openNewXY(txt,xvalue,yvalue)
    {
	if (txt != ' ')
	  {
		//windowprops = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=640,height=480';
	    	//windowprops = ''
		var winl = (screen.width - xvalue) / 2;
  		var wint = (screen.height - yvalue) / 2;
		windowprops = 'toolbar=yes,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width='+xvalue+',height=' + yvalue + ',top=' + wint + ',left=' + winl;
	    
	  }
	  if (x != 0)
	  {
		window1.close();
	  }
	
	  window1=window.open(txt,"my_new_window",windowprops);

	  //windowWidth=640;
	  //windowHeight=495;
	  //if (parseInt(navigator.appVersion) >= 4) 
		//window1.moveTo((screen.width/2)-(windowWidth/2+10),(screen.height/2)-(windowHeight/2+20));

	  x = 1;
	  return;	 
    }
	
	function openNewWin(txt,winname,xvalue,yvalue,resize) {
	    if (resize == 1)
	    {	
		    resize = 'yes'; 
	    }
	    else {	
		    resize = 'no'; 
	    }
        
	    if (txt != ' ') {
            //windowprops = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=640,height=480';
            //windowprops = ''
            var winl = Math.floor( (screen.width - xvalue) / 2);
            var wint = Math.floor( (screen.height - yvalue) / 2);
            windowprops = 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable='+resize+',copyhistory=no,width='+xvalue+',height=' + yvalue + ',top=' + wint + ',left=' + winl;
        }
	    
        window1=window.open(txt,winname,windowprops);
        window1.focus();
        
        windowWidth=xvalue;
        windowHeight=yvalue;
        if (parseInt(navigator.appVersion) >= 4) {
            window1.window.focus();
        }
        
        x = 1;
        return;
    }
    
    function openNewWin2(txt,winname,xvalue,yvalue,resize) {
        if (resize == 1) {	
	        resize = 'yes'; 
        }
        else {	
	        resize = 'no'; 
        }

        if (txt != ' ') {
            //windowprops = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=640,height=480';
            //windowprops = ''
            var winl = Math.floor( (screen.width - xvalue) / 2);
            var wint = Math.floor( (screen.height - yvalue) / 2);
            windowprops = 'toolbar=yes,location=yes,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable='+resize+',copyhistory=no,width='+xvalue+',height=' + yvalue + ',top=' + wint + ',left=' + winl;
        }

        var window1=window.open(txt,winname,windowprops);
        if( !window1 )
		{
		    window1 = window.open('',winname, windowprops);
		    window1.location.href = txt;
		}
        window1.focus();

        windowWidth=xvalue;
        windowHeight=yvalue;
        if (parseInt(navigator.appVersion) >= 4) {
            window1.window.focus();
        }
        x = 1;
        return;	 
    }

    function openNewFrame(txt,winname,xvalue,yvalue,resize)
    {
	if (resize == 1)
	{	
		resize = 'yes'; 
	}
	else
	{	
		resize = 'no'; 
	}

	if (txt != ' ')
	  {
		//windowprops = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=640,height=480';
	    //windowprops = ''
		var winl = (screen.width - xvalue) / 2;
  		var wint = (screen.height - yvalue) / 2;
		windowprops = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable='+resize+',copyhistory=no,width='+xvalue+',height=' + yvalue + ',top=' + wint + ',left=' + winl;
	    
	  }
	
	  window1=window.open(txt,winname,windowprops);
	  window1.focus();

	  windowWidth=640;
	  windowHeight=495;
	  if (parseInt(navigator.appVersion) >= 4) 
	  {
		window1.moveTo((screen.width/2)-(windowWidth/2+10),(screen.height/2)-(windowHeight/2+20));
	  }
	  x = 1;
	  return;	 
    }
