Look to openFiles.length on if statements within openPreviewWindow, closeAllTabs and alphaTabs functions so we only do these processes if we have 1 or more tabs open