function openWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}
function closeWindow(){
 // Make handle for current window
 parentwin = window.self;
 // Tell current window that it opened itself
 parentwin.opener = window.self;    
 // Close window's parent (e.g. the current window)
 parentwin.close();
}
