programname = "";

function clickaction() {
} 

function initextrawindow(programname) {
extrawindowstatus(programname);
}

function extrawindowstatus(programname) {
closeextrawindow();
openextrawindow(programname);
document.returnValue = true; 
}

// Open the extrawindow window
function openextrawindow(programname) {

// Center window on screen
//var w = 640, h = 480;
//if (document.all) {
//var w = screen.width, h = screen.height;
//}
//if (document.layers) {
//var w = window.outerWidth, h = window.outerHeight;
//}

//var popW = 630, popH = 470;
//var topPos = (w-popW)/2, leftPos = (h-popH)/2;


originalwidth = screen.availWidth;
originalheight = screen.availHeight;

newwidth = screen.availWidth;
newheight = screen.availHeight;

// subtract 50 pixels for the status bar
// newheight = newheight - 50;
// newwidth = newwidth - 50;

if(newwidth >= 690) {
newwidth = 690;
}

// var popW = newwidth, popH = newheight;
var popW = newwidth;
var popH = 350;

var leftPos = (originalwidth-popW)/2, topPos = (originalheight-popH)/2;
// override top position to 1 for now
// topPos = 1;

//var hold01 = "extrawindow=window.open('" + programname + "','extrawindow','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,width=630,height=470,resizable=1,top=" + leftPos + ",left=" + topPos + "')"
var hold01 = "extrawindow=window.open('" + programname + "','extrawindow','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,width=' + popW + ',height=' + popH + ',resizable=1,top=" + topPos + ",left=" + leftPos + "')"



eval(hold01);
}

// function to close the extrawindow window
function closeextrawindow() {
if (!window.extrawindow) {
// has not yet been defined
}
else {
// has been defined
if (!extrawindow.closed) {
extrawindow.close();
}
}
}
