Error catching when no tabs are open

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
Update file to match main JS