function newWin(url,img,title,w,h) { 
if (! (url) &&! (img)) { return; } 
var day,id,ww,wh,params,baseHeight,win; 

// This insures the images always open in a NEW window 
//instead of populating one that's left open. 
day= new Date(); 
id = day.getTime(); 

// Pad it a bit for scrollbars if passing an image size 
ww = (url)?w:w+75; 
wh = (url)?h:h+180; 

// In case you really **don't** have all the bases covered, allow scroll and resize 
//params = 'width='+ww+',height='+wh+',scrollbars,resizable'; 

params = 'width='+ww+',height='+wh+',scrollbars=no,resizable=no'; 

// Have you ever had windows falling off the bottom of the screen? 
// Remember how mad you were. Never assume you know how many toolbars will be on 
// if you're inside the window or what resolution is "best" if you're out. 
if (screen.height) { baseHeight = screen.height; } 
if (! baseHeight > 0 ) { baseHeight= 600; } 
wh = (wh>baseHeight)?baseHeight:wh; 

// if passing an image, write a doc 
if (url=='') { 
msg='<html><head><title>'+img+'<\/title>\n'+ 
'<style type="text\/css">\n'+ 
'html,body,div { font-family:Arial,Helvetica,Sans-Serif; }\n'+ 
'<\/style><\/head><body><div align="center"><h3>'+title+'<\/h3>\n'+ 
'<img src="'+img+'" width="'+w+'" height="'+h+'" border="0" ALT="'+title+'">\n'+ 
'<hr width="100%" size="1"><form action="" onSubmit="return false;">\n'+ 
'<input type="submit" onclick="javascript:window.close();" value="Close Window">\n'+ 
'<hr width="100%" size="1"><\/form><\/div><\/body><\/html>\n'; 
win = open('',id,params); 

// Upper left, as requested 
win.moveTo(50,50); 
win.document.write(msg); 
win.document.close(); 
} 

else { win = open(url,id,params); win.moveTo(0,0); } 
} 
