var remoteWin;
function newWindowC(newUrltoOpen, width, height) { 
   var winl = (screen.width - width) / 2; 
   var wint = (screen.height - height) / 2; 
   if(remoteWin && remoteWin.close) { 
       remoteWin.close(); 
       remoteWin = null; 
   } 
   else { 
       remoteWin = null; 
   } 
   if (remoteWin == null) { 
       remoteWin = window.open("","remoteWin", 
          'toolbar=0,location=0,directories=0,statusbar=0,status=0,menubar=0,scrollbars=1,resizable=1,menubar=no,copyhistory=no,width=' + width + ',height=' +  height + ',top='+wint+',left='+winl ); 
       remoteWin.location.href=newUrltoOpen; 
    } 
}