function setLinkURL(productID) {
    var langID = getCurrentLangID();
    $link = $('a.buy1');
    $link1 = $('#buy1 a');
    var url, calURL;
    if (langID == 1049) {
        url = '/buy.aspx';
        calURL = '/buy.aspx'
    }
    else {
        switch (productID) {
            case 'dw':
            case 'dwb':
                {
                    url = 'https://secure.shareit.com/shareit/cart.html?PRODUCT%5b300428021%5d=1&DELIVERY%5b300428021%5d=EML&languageid=1&backlink=' + window.location.href + '&nolselection=1&noquickbuy=1&currencies=USD';
                    break;
                }
            case 'dws':
                {
                    url = 'https://secure.shareit.com/shareit/cart.html?PRODUCT%5b300432616%5d=1&DELIVERY%5b300432616%5d=EML&languageid=1&backlink=' + window.location.href + '&nolselection=1&noquickbuy=1&currencies=USD';
                    break;
                }
            case 'dwent':
                {
                    url = 'https://secure.shareit.com/shareit/cart.html?PRODUCT[300484122]=1&DELIVERY[300484122]=EML&languageid=1&backlink=' + window.location.href + '&nolselection=1&noquickbuy=1&currencies=USD';
                    calURL = 'https://secure.shareit.com/shareit/cart.html?PRODUCT[300484124]=1&DELIVERY[300484124]=EML&languageid=1&backlink=' + window.location.href + '&nolselection=1&noquickbuy=1&currencies=USD';
                    break;
                }
        }
    }
    $link.attr('href', url);
    $link1.attr('href', calURL);
}

function redirectToBuyPage() {
    var countryCode = getCountryCode().toUpperCase();
    var codes = new Array('RU', 'UA', 'KZ', 'BY', 'UZ');
    var langID = getCurrentLangID();
    if ((langID != 1049) && (codes.indexOf(countryCode) != -1)) {
        alert('Attention! If you are located only in North America you can purchase DeskWork software online');
        return false;
    }
    else {
        return true;
    }
}

function redirectToDescriptionPage(productID) {
    switch (productID) {
        case "dw":
        case "dwb":
            {
                window.location.href = dwbPage;
                break;
            }
        case "dws":
            {
                window.location.href = dwsPage;
                break;
            }
        case "dwent":
            {
                window.location.href = dwentPage;
                break;
            }
        case "dwsaas":
            {
                window.location.href = dwsaasPage;
                break;
            }
    }
}
