
// This script is © Aephid Technologies www.aephid.com.

// The default site to use when no button other than [site x] is clicked.
var g_downloadDefaultSite = 1;

// 0 = download.aephid.com
// 1 = movedigital.com

function GetLatestCueBrainTitleVerbose()
{
  return "CueBrain 4.32";
}

function ApplySiteRules(site)
{
  // Force always download.aephid.com.
  // return 0;

  // Use as passed.
  return site; 
}

function cDownloadCueBrainForAndroidLinkBlock()
{
  this.m_parent = new cAephidLinkBlock;
  
  this.m_parent.m_TextAboveString = "Cuebrain 6.x"
  
  if(DetectAndroid())
  {
    this.m_parent.m_UrlString = "market://search?q=Aephid%20CueBrain"
  }
  else
  {
    this.m_parent.m_UrlString = "http://www.slideme.org/application/cuebrain-lite"
  }
  
  this.m_parent.m_ImageUrl = "http://qrcode.kaywa.com/img.php?s=8&d=market%3A%2F%2Fsearch%3Fq%3DAephid%2520CueBrain";
  
  this.m_parent.m_TextBelowString = "Android 1.6 and newer only"

  this.Write =
  function()
    {
      this.m_parent.Write();
   }
}

function WriteCueBrainForAndroidDownloadBlock()
{
  var block = new cDownloadCueBrainForAndroidLinkBlock();
  block.Write();
}

function cDownloadCueBrainForWindowsLinkBlock()
{
  this.m_parent = new cAephidLinkBlock;
  
  this.m_parent.m_TextAboveString = GetLatestCueBrainTitleVerbose();
  this.m_parent.m_UrlString = GetCueBrainDownloadUrl();
  this.m_parent.m_TextBelowString = GetWindowsPlatformsUsuallySupported();

  this.Write =
  function()
    {
      this.m_parent.Write();
   }
}

function WriteCueBrainForWindowsDownloadBlock()
{
  var block = new cDownloadCueBrainForWindowsLinkBlock();
  block.Write();
}

function cCueCardLinkBlock()
{
  this.SetFilenameWithoutExtension = function(FilenameWithoutExtension)
  {
    this.m_parent.m_UrlString = GetCueCardDownloadUrlBase();
    this.m_parent.m_UrlString += FilenameWithoutExtension;
    this.m_parent.m_UrlString += ".zip";
    
    this.m_parent.m_ButtonString = FilenameWithoutExtension;
    this.m_parent.m_ButtonString += ".zip";
  }

  this.SetBriefDescription = function(Text)
  {
    this.m_parent.m_TextAboveString = Text;
  }
  
  this.Write = function()
  {
    this.m_parent.Write();
  }
  
  // private:
  
  this.m_parent = new cAephidLinkBlock;

  this.m_parent.m_TextAboveString = "";
  this.m_parent.m_UrlString = "";
}

function GetWindowsPlatformsUsuallySupported()
{
  return "Windows 2000/XP/Vista/7";
}

function WriteCueBrainDownloadAHref()
{
  document.writeln(GetCueBrainDownloadUrl());

	document.writeln("'>");
}

function GetCueBrainDownloadUrl()
{   
  site = ApplySiteRules(g_downloadDefaultSite);

  if(site == 1)
  {
	  return "http://download.aephid.com/cuebrain_release.exe";
  }
  else
  {
	  return "";
  }
}

function GetCueCardDownloadUrlBase()
{   
  site = ApplySiteRules(g_downloadDefaultSite);

  if(site == 1)
  {
	  return "http://download.aephid.com/";
  }
  else
  {
	  return "";
  }
}

