var CurrentVersion = "12";            /// enter current version here.
var CurrentBuildDate = "120105";      /// enter current build date
var DownloadURL = "download/wq"+ CurrentVersion + "update/" + CurrentVersion + "-0-" + CurrentBuildDate + "/wqupdate" + CurrentBuildDate + ".zip"; 

function doUpdate(){
        window.location = DownloadURL;
}
  var query = window.location.search;
  /// This should pull in the data appended to the url - ajl
  /// Skip the leading ?, which should always be there,
  /// but be careful anyway
  if (query.substring(0, 1) == '?') {
    query = query.substring(1);
  } else {
    window.location = "qwupdates.html?ID=0.10.0.091130";   /// If no ? after html - then send to QueryWeb Designer Update page - ajl
  }
  var data = query.split('.');
  for (i = 0; (i < data.length); i++) {
    data[i] = unescape(data[i]);
  }
  var siteid = data[0];
  var BuildVersion = data[1];
  var BuildOS = data[2];
  var BuildDate = data[3];

if ( BuildVersion == CurrentVersion && BuildDate < CurrentBuildDate) 
{
  var newHTML = "<b>WinQuery</b> updates are available."; 
  document.getElementById('update1').innerHTML = newHTML;
  document.write("<input type='button' onclick='doUpdate()' value='Download Update'/>");
  document.write("<br/><br/>Download file is password protected.<br/><br>Please contact <a href='mailto:Scott.Smith@AnalyticalGroup.com'><font color='#0000FF'><u>Scott.Smith@AnalyticalGroup.com</u></font></a> for your company's password.</br>");
}

