function calculateOpts(w, h, sizeable) {
var tp = null, lf = null;
var opts = 'width=' + Number(w).toString() + ',height=' + Number(h).toString();

   if (!sizeable) {
      opts = opts + ',location=no,menubar=yes,resizable=no,scrollbars=yes,status=no,toolbar=no,directories=no,channelmode=no';
   } else {
      opts = opts + ',location=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes,directories=yes,channelmode=yes';
   }

	if (screen != null) {
	   if (screen.height <= 600) {
	        tp = 0;	
           } else {                	
    	   	tp = screen.height;
	        if (tp != null) {
			tp = (tp - h) / 2 - 25; 
	        }
           } 
	   if (screen.height <= 600) {
	        lf = 20;	
           } else {                	
  	        lf = screen.width;
  	        if (lf != null) {
		   lf = (lf - w) / 2; 
  	        }
      } 
	}
			 
	if (lf != null) {
		opts = opts + ',left=' + new Number(lf).toString();
	}
		
	if (tp != null) {
		opts = opts +  ',top=' + new Number(tp).toString();
	}	

   return (opts);
}

function windowPrint(obj) {
	obj.print();
   return false;
}

function windowOpenURL(url, tgt, w, h, sizeable) {
   window.open(url, tgt, calculateOpts(w, h, sizeable));
   return false;
}

