function openwin(url, winName)
{
    agent = navigator.userAgent;
    win = window.open(url, winName); 
  
    if ((agent.indexOf("Mozilla/2") != -1) && (agent.indexOf("Win") == -1))
    { 
        win = window.open(url, winName); 
    } 
       
    if (!win.opener) { 
        win.opener = window; 
    } 
       
     // bring the window to the front 
     win.focus();      
}