// useful javascript functions // create a popup window - 21/03/09 - gavin taylor function popup(link, windowname, width, height, scrollbars, status, resizable, location, toolbar, menubar) { if(!window.focus) { return true; } //check if additional options are set if(scrollbars == null) { scrollbars = 'no'; } if(status == null) { status = 'no'; } if(resizable == null) { resizable = 'no'; } if(location == null) { location = 'no'; } if(toolbar == null) { toolbar = 'no'; } if(menubar == null) { menubar = 'no'; } var href; if(typeof(link) == 'string') { href=link; } else { href=link.href; } //window position var posleft = (screen.width - width) / 2; var postop = (screen.height - height) / 2; newwindow = window.open(href, windowname, 'width=' + width + ', height=' + height + ',left=' + posleft + ',top=' + postop + ',scrollbars=' + scrollbars + ',status=' + status + ',resizable=' + resizable + ',location=' + location + ',toolbar=' + toolbar + ',menubar=' + menubar + ''); if(window.focus) {newwindow.focus()} return false; }