jQuery.fn.tabs = function() {
    this.each(function(index) {
        var tab_obj = $(this);
        var tab_inlays = tab_obj.find('div.tab-inlays a');
        var tab_inlays_body = tab_obj.find('div.tab-inlays-body div.cnt');

        if (tab_inlays_body.length == 0) {
            var tab_inlays_body = tab_obj.find('div.tab-inlays-body div');
        }

        if (tab_inlays.length != tab_inlays_body.length) {
            alert('error init tabs'); return;
        }

        for (var i = 0; i < tab_inlays.length; i++) {
            var current_inlay = $(tab_inlays[i]).attr('id', 'tab_inlay_' + index + '_' + i);
            var cuurent_inlay_body = $(tab_inlays_body[i]).attr('id', 'tab_inlay_' + index + '_' + i + '_body');;

            if (!current_inlay.hasClass('selected')) {
                cuurent_inlay_body.hide();
            }

            current_inlay.click(function(e) {
                if (!$(this).hasClass('lock')) {
                    tab_inlays.removeClass('selected');
                    var inlay = $(this).addClass('selected');
                    var id = inlay.attr('id');

                    tab_inlays_body.hide();
                    $('#' + id + '_body').show();
                }
                e.returnValue = false;
                e.preventDefault();
                return false;
            });
        }
    });
}

function showTabProductComparison()
{
    var $tab_inlays = $('div.tabs').find('div.tab-inlays a');
    var $tab_sheets = $('div.tabs').find('div.tab-inlays-body div.cnt')

    for (var i = 0; i < $tab_inlays.length; i++) {
        var current_inlay = $($tab_inlays[i]);
        if (current_inlay.find('span.tab-button-icon').hasClass('comparison')) {
            $tab_inlays.removeClass('selected');
            current_inlay.addClass('selected');
            $tab_sheets.hide();
            var id = current_inlay.attr('id');
            $('#' + id + '_body').show();
        }
    }

    return false;
}

jQuery(document).ready(
    function()
    {
/*    	
        $("div.tabs").tabs();

        var flashvars = {
            'width':640,
            'height':385
        };
        var params = {
            'allowscriptaccess':'always',
            'allowfullscreen':true,
            'wmode':'transparent'
        };

        var play_this = 'http://www.youtube.com/v/700uK45oF_A&hl=en&fs=1&rel=0&autoplay=1';
        swfobject.embedSWF(play_this, 'media_player', 640, 385, "8.0.0", "expressInstall.swf", flashvars, params);
*/        
    }
);