//This fN open a popup window

function popup_win(name) {
	var URL = name;
	var windowW = 520, windowH = 500;
						
	if (document.all){
	   var screenW = screen.width, screenH = screen.height;
	}
			
	var xOffset = (screenW - windowW)/2, yOffset = (screenH - windowH)/2;
			
	var wFeatures = 'width=' + windowW  
	+ ',height=' + windowH							
	+ ',screenX=' + xOffset 
	+ ',screenY=' + yOffset
	+ ',top='+ yOffset 
	+ ',left=' + xOffset
	+ ',dependent=yes'
   + ',scrollbars=yes'
   + ',resizable=yes';								

	if (!window.Popup) {				
	  Popup = window.open(URL,'Popup', wFeatures); 
	  Popup.location.href = URL;	   	  
	}
	else{
	// has been defined
	  if (!Popup.closed) {
	    // still open
	    Popup.focus(); 				
	    Popup.location.href = URL;
	   }
	   else {
	     Popup = window.open(URL,'Popup', wFeatures);
	     Popup.location.href = URL;
	     if (Popup.opener == null) Popup.opener = self;
	   }    		
	 } 
			
  }//end of function popup_win	
