/**
 * opens sized browser window
 */
function openWindow(name, url, width, height){
    popupWin = window.open(url, name, "width="+(width+20)+", height="+(height+40)+", scrollbars=yes,resizable=yes");
    popupWin.focus;
}

/**
 * move opened window to center of user's screen
 */
function moveToCenter(){
    
    if (document.layers) {
	self_w = window.innerWidth;
	self_h = window.innerHeight;
    } else  {
	self_w = document.body.clientWidth;
	self_h = document.body.clientHeight;
    }

    win_w = screen.availWidth;
    win_h = screen.availHeight;
    
    var leftPos = (win_w-self_w)/2;
    var topPos = (win_h-self_h)/2;

    self.moveTo(leftPos, topPos);
}

/**
 * maximize window
 */
function maximize(){
    self.moveTo(0,0); 
    self.resizeTo(screen.availWidth,screen.availHeight); 
}
