function init_download(link) { 
   if (navigator.appVersion.indexOf('MSIE') != -1 ) { 
      window.open(link, 'download_window', 'toolbar=0,location=no,directories=0,status=0,scrollbars=0,resizeable=0,width=1,height=1,top=0,left=0');          window.focus(); 
   }
} 

function download_click() {
   if (navigator.appVersion.indexOf('MSIE') != -1 ) { 
      winData = navigator.userAgent;
      if ((winData.indexOf('Win64') != -1) || (winData.indexOf('WOW64') != -1))
      {
        init_download_1(2);
      }
      else
      {
        init_download_1(1);
      }
   }
   else {
      window.location ="http://www.leo4office.com/?page_id=8";
   }
} 

function init_download_1(type) { 
   if (navigator.appVersion.indexOf('MSIE') != -1 ) { 
      download_url = get_download_url(type);
      window.open(download_url, 'download_window', 'toolbar=0,location=no,directories=0,status=0,scrollbars=0,resizeable=0,width=1,height=1,top=0,left=0');
      window.focus(); 
      window.location ="http://www.leo4office.com/?page_id=184&type=" + type;
   }
   else {
      window.location ="http://www.leo4office.com/?page_id=184&type=" + type;
   }
} 

function get_download_url(type)
{
if (type == 1)
{
return "http://download.KryonSystems.com/V2/LeoPlayerFullSetup_x86.exe";
}
if (type == 2)
{
return "http://download.KryonSystems.com/V2/LeoPlayerFullSetup_x64.exe";
}
if (type == 3)
{
return "http://download.KryonSystems.com/V2/LeoPlayerFullSetup_x86x64.exe";
}
if (type == 4)
{
return "http://download.KryonSystems.com/V2/LeoPlayerFullSetup_x86_PreReq.exe";
}
if (type == 5)
{
return "http://download.KryonSystems.com/V2/LeoPlayerFullSetup_x64_PreReq.exe";
}
else
{
return "http://download.KryonSystems.com/V2/LeoPlayerWebSetup.exe";
}
}

function qs() {
var qsParm = new Array();
var query = window.location.search.substring(1);
var parms = query.split('&');
for (var i=0; i<parms.length; i++) {
var pos = parms[i].indexOf('=');
if (pos > 0) {
var key = parms[i].substring(0,pos);
var val = parms[i].substring(pos+1);
qsParm[key] = val;
}
}
return qsParm;
}
