programname = "";

function clickaction() {
} 

function initbrochurewindow(programname) {
brochurewindowstatus(programname);
}

function brochurewindowstatus(programname) {
closebrochurewindow();
openbrochurewindow(programname);
document.returnValue = true; 
}

// Open the brochurewindow window
function openbrochurewindow(programname) {

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 >= 660) {
newwidth = 660;
}

var popW = newwidth, popH = newheight;

var leftPos = (originalwidth-popW)/2, topPos = (originalheight-popH)/2;
// override top position to 1 for now
topPos = 1;

var hold01 = "brochurewindow=window.open('" + programname + "','brochurewindow','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 brochurewindow window
function closebrochurewindow() {
if (!window.brochurewindow) {
// has not yet been defined
}
else {
// has been defined
if (!brochurewindow.closed) {
brochurewindow.close();
}
}
}

