function getOS()
{
    $os = 'unknown';
    if (preg_match('/windows/i', $_SERVER['HTTP_USER_AGENT'])) {
        $os = 'windows';
    } elseif (preg_match('/macintosh|mac os x/i', $_SERVER['HTTP_USER_AGENT'])) {
        $os = 'mac';
    } elseif (preg_match('/ubuntu/i', $_SERVER['HTTP_USER_AGENT'])) {
        $os = 'ubuntu';
    } elseif (preg_match('/debian/i', $_SERVER['HTTP_USER_AGENT'])) {
        $os = 'debian';
    } elseif (preg_match('/archlinux/i', $_SERVER['HTTP_USER_AGENT'])) {
        $os = 'arch';
    } elseif (preg_match('/linux/i', $_SERVER['HTTP_USER_AGENT'])) {
        $os = 'linux' . getArch();
    }
    return $os;
}
$download['windowspackage']['url'] = '';
$download['windowspackage']['img'] = $protocol . 'static.getnightingale.com/images/wine.png';
$download['windowspackage']['osname'] = 'Windows';
$download['windowspackage']['arch'] = 32;
$download['windowspackage']['package'] = '.zip';
$download['windowspackage']['popup'] = false;
$download['mac']['url'] = '';
$download['mac']['img'] = $protocol . 'static.getnightingale.com/images/dmg.png';
$download['mac']['osname'] = 'Mac OS X';
$download['mac']['arch'] = 32;
$download['mac']['package'] = '.dmg';
$download['mac']['popup'] = false;
$download['ubuntu']['url'] = '';
$download['ubuntu']['img'] = $protocol . 'static.getnightingale.com/images/start-here-ubuntuoriginal.png';
$download['ubuntu']['osname'] = 'Ubuntu';
$download['ubuntu']['arch'] = getArch();
$download['ubuntu']['package'] = 'PPA';
$download['ubuntu']['popup'] = true;
$download['ubuntu']['popupPackageName'] = 'nightingale';
$download['arch']['url'] = 'https://aur.archlinux.org/packages/nightingale-git/';
$download['arch']['img'] = $protocol . 'static.getnightingale.com/images/package-x-generic.png';
$download['arch']['osname'] = 'Archlinux';
$download['arch']['arch'] = 32;
$download['arch']['package'] = 'PKGBUILD';
$download['arch']['popup'] = false;
$download['linux32']['url'] = '';
$download['linux32']['img'] = $protocol . 'static.getnightingale.com/images/package-x-generic.png';
$download['linux32']['osname'] = 'Linux';
$download['linux32']['arch'] = 32;
$download['linux32']['package'] = '.tar.bz2';
$download['linux32']['popup'] = false;
$download['debian']['url'] = '';
$download['debian']['img'] = $protocol . 'static.getnightingale.com/images/application-x-deb.png';
$download['debian']['osname'] = 'Debian';
$download['debian']['arch'] = 32;
$download['debian']['package'] = '.deb';
$download['debian']['popup'] = false;
$download['arch']['url'] = 'https://aur.archlinux.org/packages/nightingale-git/';
$download['arch']['img'] = $protocol . 'static.getnightingale.com/images/package-x-generic.png';
$download['arch']['osname'] = 'Archlinux';
$download['arch']['arch'] = 32;
$download['arch']['package'] = 'PKGBUILD';
$download['arch']['popup'] = false;
$download['gentoo']['url'] = 'https://bugs.gentoo.org/show_bug.cgi?id=316443';
$download['gentoo']['img'] = $protocol . 'static.getnightingale.com/images/package-x-generic.png';
$download['gentoo']['osname'] = 'Gentoo';
$download['gentoo']['arch'] = getArch();
$download['gentoo']['package'] = 'ebuild';
$download['gentoo']['popup'] = false;
$download['linux32']['url'] = $github_download_url . 'Nightingale_' . $version . '-' . $build . '_linux-i686.tar.bz2';
$download['linux32']['img'] = $protocol . 'static.getnightingale.com/images/package-x-generic.png';
$download['linux32']['osname'] = 'Linux';
$download['linux32']['arch'] = 32;
$download['linux32']['package'] = '.tar.bz2';
$download['linux32']['popup'] = false;
$download['linux64']['url'] = $github_download_url . 'Nightingale_' . $version . '-' . $build . '_linux-x86_64.tar.bz2';
$download['linux64']['img'] = $protocol . 'static.getnightingale.com/images/package-x-generic.png';
$download['linux64']['osname'] = 'Linux';
$download['linux64']['arch'] = 64;
$download['linux64']['package'] = '.tar.bz2';
$download['linux64']['popup'] = false;
$download[$UNKNOWN]['url'] = '/download.php';