﻿$(document).ready(function () {
    localizeRadWindow();
	
	$('.slider').css('display', 'block');

	$('.slide').cycle({ 
		fx:     'fade', 
		speed:  'fast', 
		timeout: 0, 
		next:   '.slider-left', 
		prev:   '.slider-right' 
	});
	
    $('hr:not(.clear)').wrap('<div class="horizontal-line" />');

    var partnerRows = $('table.partner-tip tr');
	
	
    //foreach partner row
    $.each(partnerRows, function (key, value) {
        if ((key % 2) == 0) {//partner img row
            var cells = $('table.partner-tip tr:nth-child(' + (key + 1) + ') td');

            $.each(cells, function (k, v) {
                var imgCell = $('table.partner-tip tr:nth-child(' + (key + 1) + ') td:nth-child(' + (k + 1) + ')');
                var txtCell = $('table.partner-tip tr:nth-child(' + (key + 2) + ') td:nth-child(' + (k + 1) + ')');

                $(txtCell).css('display', 'none');

                var value = $(txtCell).html();

                $(imgCell).qtip({
                    content: value,
                    style: {
                        width: 178,
                        textAlign: 'left',
                        border: {
                            width: 3,
                            color: '#f8dae3'
                        },
                        tip: {
                            corner: 'bottomMiddle',
                            size: {
                                x: 18,
                                y: 20
                            }
                        }
                    },
                    position: {
                        corner: {
                            target: 'topMiddle',
                            tooltip: 'bottomMiddle'
                        }
                    },
                    show: 'mouseover',
                    hide: 'mouseout',
                    name: 'light'
                });
            });
        }
    });
});

function localizeRadWindow() {
    try {
        Telerik.Web.UI.RadWindowUtils.Localization =
            {
                "Close": "Zavřít",
                "Minimize": "Minimalizovat",
                "Maximize": "Maximalizovat",
                "Reload": "Aktualizovat",
                "PinOn": "Zakotvit na tomto místě",
                "PinOff": "Odkotvit",
                "Restore": "Obnovit",
                "OK": "OK",
                "Cancel": "Zrušit"
            };
    }
    catch (e) { }
}

