﻿function Download(DownloadType, File) 
{
    if (File == null) return;
    switch (DownloadType) 
    {

        case 1: //flux User
            if (Temp1 != '1') 
            {
                document.write('<img style="margin: 0 0 0 0; padding: 0 0 0 0" src="images/stories/download.gif" width="22" height="18" border="0">');
                document.write('&nbsp;&nbsp;Available only for Registered Developers.&nbsp;Click <a href="index.php?option=com_content&view=article&id=41">here</a> to login.');            
            }
            else 
            {
                document.write('<a href="fluxApp/Download.aspx?ID=' + File + '"><img style="margin: 0 0 0 0; padding: 0 0 0 0" src="images/stories/download.gif" width="22" height="18" border="0">' + File + '</a>');
            }
            break;
        case 2: //NDA  User
            if (Temp2 != '1') 
            {
                document.write('<img style="margin: 0 0 0 0; padding: 0 0 0 0" src="images/stories/download.gif" width="22" height="18" border="0">');
                document.write('&nbsp;&nbsp;Available only after signing an NDA.&nbsp;Click <a href="index.php?option=com_content&view=article&id=41">here</a> to login.');            
            }
            else 
            {
                document.write('<a href="fluxApp/Download.aspx?ID=' + File + '"><img style="margin: 0 0 0 0; padding: 0 0 0 0" src="images/stories/download.gif" width="22" height="18" border="0">' + File + '</a>');
            }
            break;
        default:
            document.write('<a href="fluxApp/Download.aspx?ID=' + File + '"><img style="margin: 0 0 0 0; padding: 0 0 0 0" src="images/stories/download.gif" width="22" height="18" border="0">' + File + '</a>');
            break;        
    }
}

function DownloadFromURL(DownloadType, File, URL) 
{
    if (File == null) return;
    switch (DownloadType) 
    {
        case 1: //flux User
            if (Temp1 != '1') 
            {
                document.write('<img style="margin: 0 0 0 0; padding: 0 0 0 0" src="images/stories/download.gif" width="22" height="18" border="0">');
                document.write('&nbsp;&nbsp;Available only for Registered Developers.&nbsp;Click <a href="index.php?option=com_content&view=article&id=41">here</a> to login.');
            }
            else 
            {
                document.write('<a href="' + URL + '"><img style="margin: 0 0 0 0; padding: 0 0 0 0" src="images/stories/download.gif" width="22" height="18" border="0">' + File + '</a>');
            }
            break;
        case 2: //NDA  User
            if (Temp2 != '1') 
            {
                document.write('<img style="margin: 0 0 0 0; padding: 0 0 0 0" src="images/stories/download.gif" width="22" height="18" border="0">');
                document.write('&nbsp;&nbsp;Available only after signing an NDA.&nbsp;Click <a href="index.php?option=com_content&view=article&id=41">here</a> to login.');
            }
            else 
            {
                document.write('<a href="' + URL + '"><img style="margin: 0 0 0 0; padding: 0 0 0 0" src="images/stories/download.gif" width="22" height="18" border="0">' + File + '</a>');
            }
            break;
        default:
            document.write('<a href="' + URL + '"><img style="margin: 0 0 0 0; padding: 0 0 0 0" src="images/stories/download.gif" width="22" height="18" border="0">' + File + '</a>');
            break;
    }
}
