$(document).ready(function(){
    $('.t-conv').on('click', function(e){
        e.preventDefault();

        var t = $(this).data('conv');
        $('.w-tconv').each(function(i){
            var $e = $(this);
            $e.html($e.data(t));
        });
    });

    $('#print-weather').on('click', function(e){
        e.preventDefault();

        var form_data = {};

        form_data['csurl'] = encodeURIComponent(full_uri + "amodules/cyprus_weather/cyprus_weather_print.php");
        form_data['baseurl'] = baseurl;
        //console.log(form_data);
        $.ajax({
            url: baseurl + '/proxy.php',
            data: form_data,
            type: 'post',
            dataType: 'json',
            async: false,
            cache: false,
            success: function(r) {
                if(r.result == 1) {
                    if(r.hasOwnProperty('flashm')) {
                        $.post(baseurl + '/flashm.php', {'flashm': r.flashm});
                    }
                    window.redirectLink = r.link;
                    window.setTimeout(function(){
                        var rlink = window.redirectLink;
                        delete(window.redirectLink);
                        document.location.href = rlink;
                    }, 200);

                }

            }
        });



    });
});
