
function wopen(wurl,wname,ww,wh,wtitle)
//function wopen(wurl,wname,ww,wh,wdir,wloc,wmenu,wsize,wscroll,wstat,wtool,wtitle)
//wurl = URL to open
//wname = name
//ww,wh = width, height
//wdir = directories --- 0
//wloc = location --- 0
//wmenu = menubar --- 0
//wsize = resizable --- only if ww/wh > available
//wscroll = scrollbars --- only if ww/wh > available
//wstat = status bar --- 0
//wtool = toolbar --- 0
//wtitle = popuptitle --- ignored if = 'playKingdoms')
{
    var strf ;
    var wscroll;
	var wsize;
    
    wsize=0;
    wscroll=0;
    
    // if width or height > available, set it to available, and enable scroll and resizing

    if (ww > screen.availWidth) 
    {
	ww = screen.availWidth;
	wscroll = 1;
	wsize = 1;
    }
    if (wh > screen.availHeight) 
    {
	wh = screen.availHeight;
	wscroll = 1;
	wsize = 1;
    }

    strf = 'width=' + ww + ',height=' + wh + ',directories=0';
    strf = strf + ',menubar=0,location=0,status=0,toolbar=0';
    strf = strf + ',resizable=' + wsize;
	strf = strf + ',scrollbars=' + wscroll;
    
    var myWindow = window.open(wurl,wname,strf);
}


