﻿// JScript File
function openImageWindow(title, image)
{
    var w = 497;
    var h = 510; 
    
    var l = (window.screen.width - w) / 2;
    var t = (window.screen.height - h) / 2; 
    
    imgWindow = window.open('','',"toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=" + w + ",height=" + h + ",left=" + l + ",top=" + t);
    imgWindow.document.write('<html><head><title>' + title + '</title></head><body style="margin:0px"><table align="center"><tr><td valign="top"><img src="' + image + '" border="0"></td></tr></table></body></html>');
}

function refRedirection(url)
{
    var dummyLink = document.createElement("a");
    if (typeof(dummyLink.click) == 'undefined')
    {
        document.location.href = url;  // sends referrer in FF, not in IE
    }
    else
    {
        dummyLink.href = url;
        document.body.appendChild(dummyLink);
        dummyLink.click();   // click() method defined in IE only
    }
}
function downloadAndRedirect()
{
  var sURLreg = "http://www.safe-installation.com/supro/downloadclient.htm?DownloadBrand=suprocasino";
  var localScut = (sCut) ? sCut : "";
  sURLreg += '&' + localScut;
   
  var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
  if (is_chrome) {
    window.location.href = sURLreg;
  }
  else {
    window.open(sURLreg, "popDown", "width=620,height=150,top=0,left=0");
  }}
  
function downloadandredirect()
{
    downloadAndRedirect();
}

/*function downloadAndRedirect()
{
    var lang = getLanguage();    
    var downloadUrl = '../../../../DirectDownload.ashx@lang=' + lang;
    var redirectionUrl = '../../../../en-GB/getting-started/installation/';
    
    switch (lang)
    {
        case 'da-dk':
            redirectionUrl = '../../../../da-DK/getting-started/installation/default.htm';
            break;
        case 'de-de':
            redirectionUrl = '../../../getting-started/installation/default.htm';
            break;
        case 'en-gb':
            redirectionUrl = '../../../../en-GB/getting-started/installation/default.htm';
            break;
        case 'es-es':
            redirectionUrl = '../../../../es-ES/getting-started/installation/default.htm';
            break;
        case 'nl-nl': 
            redirectionUrl = '../../../../nl-NL/getting-started/installation/default.htm';
            break;
        case 'fr-fr':
            redirectionUrl = '../../../../fr-FR/getting-started/installation/default.htm';
            break;
        case 'it-it':
            redirectionUrl = '../../../../it-IT/getting-started/installation/default.htm';
            break;
        case 'pt-pt':
            redirectionUrl = '../../../../pt-PT/getting-started/installation/default.htm';
            break;
        case 'sv-se':
            redirectionUrl = '../../../../sv-SE/getting-started/installation/default.htm';
            break;
        default:
            redirectionUrl = '../../../../en-GB/getting-started/installation/default.htm';
            break;
    }
    
    document.location.href = downloadUrl;
    window.setTimeout('refRedirection(\'' + redirectionUrl + '\');', 7000);
}*/

