

function open_window(url){
	mywin = window.open(url,"win1",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,left=80,top=50,width=550,height=450')
	if (mywin.opener == null) mywin.opener = self;
}
		


function open_window2(url,wid,hei){
	mywin = window.open(url,"win1",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,left=80,top=50,width=' + wid + ',height=' + hei)
	if (mywin.opener == null) mywin.opener = self;
}

var mywin=null;
function popup(curl,wdth,hgth){ //curl - path to popup.asp, wdth and hgth - actual image sizes
    var w=wdth,h=hgth;
    if(w != null && h == null){ h = w; w = null; } //swap w and h if only 2 arguments    
    w = (w != null)?w:300; //default w
    h = (h != null)?h:300; //default h          
    h = (h + 55); //increase size for 'Close Window' link
    if (mywin != null && !mywin.closed ){                        
        if(document.all){ //IE - just resize window if open 
            mywin.location.replace(curl);
            mywin.resizeTo(w,h+30); //give even more height for IE
        }
        else{ //Netscape? - need to reopen
            mywin.close();
            mywin=null;
        }              
    }                       
   if(mywin == null || mywin.closed){				
        mywin = window.open(curl,'popup','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,left=80,top=50,width='+w+',height='+h+'');
    }            		
    mywin.focus();      
}        
    
function cleanUp(){ //call this in body onunload 
if(mywin != null && !mywin.closed) mywin.close();
}


function popChat(url,boxname,w,h) {
			window.open(url , boxname , 'width='+w+',height='+h+',left=0,top=0,menubar=0,toolbar=0,status=0,resizable=0');
		}