if (!window.IIHCE) window.IIHCE = {};
if (!IIHCE.res) IIHCE.res = {};

//IIHCE.res["notificationPopup.lockedDrill.title"] = "Locked Drill";
//IIHCE.res["notificationPopup.lockedDrill.text"] = "This drill is only available on paid accounts.";

(function($) {

    IIHCE.notificationPopup = null;

    IIHCE.closeNotificationPopup = function() {
        if (IIHCE.notificationPopup) {
            IIHCE.notificationPopup.fadeOut("fast", function() { $(this).remove(); });
            IIHCE.notificationPopup = null;
        }

        return false;
    };

    IIHCE.showNotificationPopup = function(el, type, tabId) {
        el = $(el);
        var pos = el.offset();

        IIHCE.closeNotificationPopup();
        IIHCE.notificationPopup = $("<div class=\"notificationpopup notificationpopup" + type + "\" style=\"display: none\">\
        <div class=\"notificationpopupcontent\">\
            <h2>" + IIHCE.res["notificationPopup." + type + ".title"] + "</h2>\
            <p>" + IIHCE.res["notificationPopup." + type + ".text"] + "</p>\
            <div class=\"linecontainer lcright\"><a href=\"#\" class=\"bluebutton closelink\">OK</a></div>\
        </div>\
    </div>");

        IIHCE.notificationPopup.find("a.closelink").click(IIHCE.closeNotificationPopup);
        IIHCE.notificationPopup.css({ left: (pos.left + 100) + "px", top: (pos.top + 8) + "px" }).appendTo("body").fadeIn("fast");
        return false;
    };
    
    IIHCE.positionVideoPopup = function() {
        $("#popupcontainer").css("top", $(document).scrollTop() + "px");
    };
    
    
    IIHCE.openDrillLink = function(link) {
        if (!link)
            return true;
        
        var m = link.match(/#(?:playlist-(\d+)(?:-(\d+))?|drill-(\d+))$/);
        if (m) {
            var listId = "-1", listDataItemId = "-1";

            if (m[1])
                listId = m[1];
            if (m[2])
                listDataItemId = m[2];
            if (m[3])
                listDataItemId = m[3];

            //$("#VideoDisplay_Control").val(listId + "," + listDataItemId);
            __doPostBack("dnn$VideoDisplay$upVideoDisplay", listId + "," + listDataItemId);

            return false;
        }
        
        return true
    }

    IIHCE.linkHandler = function(e) {
        var link = $(e.target);
        
        if (!link.is("a"))
            link = link.parents("a");
            
        if (link.length)
            return IIHCE.openDrillLink(link.attr("href"));
    };

    $("body").click(IIHCE.linkHandler);

    jQuery.fn.getId = function(type) {
        var c = $(this).attr("class");
        if (!c) return null;
        var m = c.match(new RegExp("\\b" + type + "(\\d+)\\b"));
        if (m) return m[1];
        return null;
    };
    
    function removeBrokenPlugin(event, name) {
        var plugins = jQuery.ui.draggable.prototype.plugins[event];
        for (var i = 0; i < plugins.length; i++) {
            if (plugins[i][0] == name) {
                plugins.splice(i, 1);
                break;
            }
        }
    }
    
    //removeBrokenPlugin("start", "stack");
    //removeBrokenPlugin("start", "zIndex");
    //removeBrokenPlugin("stop", "zIndex");
            
    jQuery.fn.listDragDrop = function(clientId) {
        jQuery.each(this, function() {
            var root = $(this);
            root.find("a[href='" + window.location + "']").parent().addClass("clickedlink");
            var dropped = false;

            var drop = function(e, ui) {
                if (dropped)
                    return false;
                    
                dropped = true;
                var gid = $(this).getId("gid"), lid = ui.draggable.getId("lid");
                __doPostBack(clientId, "move," + lid + "," + gid);
                
                setTimeout(function() {
                    root.find(".list").draggable("destroy");
                    root.find(".listgroup").droppable("destroy");
                }, 0);
            };

            root.find(".list").draggable({
                distance: 3,
                revert: "invalid",
                scroll: true,
                revertDuration: 200,
                zIndex: 100,
                helper: function() {
                    var a = $("<a>").addClass("list").text($(this).text()).css({"cursor": "pointer"});
                    a.bind("click", function() { return false; });
                    return a;
                }
            });

            root.find(".listgroupdrop").droppable({
                accept: ".list",
                tolerance: "pointer",
                activeClass: "dropactive",
                hoverClass: "drophover"
            }).bind("drop", drop);
        });
    };

    jQuery.fn.ExpandCollapse = function() {
        return $(this).each(function() {
            var root = $(this);
            root.click(function(e) {
                var link = $(this);
                var container = $(this).parent().next();
                container.toggle();
                container.is(':visible') ? link.parent().removeClass('collapsed') : link.parent().addClass('collapsed');
            });
        });
    };

    jQuery.fn.hoverableDelete = function(closelink, popupcontainer, row) {
        var close = $(closelink);
        var popup = $(popupcontainer);
        var tr = $(row);
        var t = null;
        return $(this).each(function() {
            var root = $(this);

            popup.hide().appendTo($('#Form'));
            tr.add(tr.find('td')).bind('hover mouseover', function() {
                if (t) clearTimeout(t);
                t = setTimeout(function() {
                    tr.addClass('hoverableDelete');
                }, 100);
            }).bind('mouseout', function() {
                if (t) clearTimeout(t);
                t = setTimeout(function() {
                    tr.removeClass('hoverableDelete');
                }, 100);
            });

            root.click(function(e) {
                e.preventDefault();
                popup.css({
                    left: $(window).width() / 2 - popup.outerWidth() / 2,
                    top: ($(window).scrollTop() + ($(window).height() / 2)) - popup.outerWidth() / 2
                }).show();
            });

            close.click(function(e) {
                e.preventDefault();
                popup.hide();
            });
        });
    }


    jQuery.fn.toggleVisibility = function(id, stateInput) {
        var stateInput = $(stateInput);
        var open = jQuery.grep(stateInput.val().split(","), function(e) { return e != ""; });
        
        jQuery.each(this, function() {
            //    $(this).click(function() {
            $(this).parent().toggleClass("toggleopen")
                .next(".toggleable").toggle();

            if ($(this).parent().hasClass("toggleopen"))
                open.push(id);
            else
                open = jQuery.grep(open, function(e) { return e != id; });
            stateInput[0].value = open.join(",");
            //    });
        });
    };

    jQuery.fn.toggleable = function(stateInput) {
        var stateInput = $(stateInput);
        var open = jQuery.grep(stateInput.val().split(" "), function(e) { return e != ""; });

        jQuery.each(this, function() {
            var self = $(this);
            var elm = self.next(".toggleable");
            //var elm = self.next().next();
            var id = elm.attr("id");
            /*if (jQuery.inArray(id, open) != -1) {*/
            if (elm.find('input:checkbox:checked').length) {
                self.addClass("toggleopen");
                elm.show();
            } else {
                elm.hide();
            }

            self.each(function() {
                var a = $(this).find('a');
                a.attr('disabled') == 'disabled' ? a.addClass('funcdisabled') : '';
            });
            self.click(function(e) {
                if (self.hasClass("toggleopen") || self.find('a').attr('disabled') == 'disabled') {
                    open = jQuery.grep(open, function(e) { return e != id; });
                    self.removeClass("toggleopen");
                    elm.hide();
                } else {
                    open.push(id);
                    self.addClass("toggleopen");
                    elm.show();
                }

                stateInput.val(open.join(" "));
                e.preventDefault();
            });
        });
    };

    jQuery.fn.selectAll = function() {
        jQuery.each(this, function() {
            var self = $(this);

            var toggleInput = self.find("input[type=checkbox].selectall");
            if (toggleInput.length != 1)
                return;

            var inputs = self.find("input[type=checkbox]").not(".selectall");
            if (inputs.length <= 1) {
                toggleInput.attr("checked", false).attr("disabled", true);
                return;
            }
            var selectedCount = 0;

            function update() {
                selectedCount = 0;
                inputs.each(function() {
                    if (this.checked)
                        selectedCount++;
                });
                toggleInput.attr("checked", selectedCount == inputs.length);
            }

            function toggle() {
                inputs.attr("checked", toggleInput.attr("checked"));
                update();
            }

            inputs.change(update);
            toggleInput.change(toggle);

            update();
        });

        return this;
    };

    jQuery.fn.MoveForm = function() {
        $(this).each(function() {
            var root = $(this);
            var popup = $(document).find('#formpopup');
            var shade = $(document).find('#popupshader');
            popup.css('top', root.offset().top - popup.height() - 50);
            shade.css('height', $(document).height()).css('position', 'absolute');
        });
    };

    jQuery.fn.AppendForm = function(selector) {
        $(this).each(function() {
            var root = $(this);
            var popup = root.find('#formpopup').appendTo('#Form');

            $(selector).click(function() {
                popup.css('top', $(this).offset().top);
            });

        });
    };

    jQuery.fn.quickLinkDropdown = function() {
        jQuery.each(this, function() {
            var timer = null, self = $(this), dropdown = self.next('ul.qldropdown');

            self.add(dropdown).hover(function() {
                self.addClass("hover");
                dropdown.css("left", self.position().left + "px");
                dropdown.show();

                if (timer) {
                    clearTimeout(timer);
                    timer = null;
                }
            }, function() {
                if (!timer) {
                    timer = setTimeout(function() {
                        self.removeClass("hover");
                        dropdown.hide();
                        timer = null;
                    }, 100);
                }
            });
        });
    };

    showAdditional = function(event, target) {
        $(target).slideDown('fast');
        if(event.preventDefault){
            event.preventDefault();
        }else{
            event.returnValue = false; 
        };
        return false;
    };

    jQuery.fn.loginBox = function() {
        return $(this).each(function() {

            var self = $(this), dropdown = self.next('.LoginForm');
            var additionalLinks = $('a.login');
            self.add(additionalLinks).click(function(e) {
                window.scrollTo(0, 0);
                if (!self.hasClass('hover')) {
                    self.addClass("hover");
                    dropdown.show().find('input:text:visible:first').focus();
                } else {
                    self.removeClass('hover');
                    dropdown.hide();
                }
                e.preventDefault();
                e.stopPropagation();
            });

            $(function() {
                dropdown.css("left", self.position().left - dropdown.outerWidth() + self.outerWidth() + parseInt(self.css('margin-left')));
                if ($('.LoginForm:has(.warningbox)').length) {
                    self.addClass('hover');
                    dropdown.show();
                }
            });

            $(document).click(function(e) {
                var target = $(e.target);
                if (target.parents().filter('.LoginForm').length < 1) {
                    self.removeClass('hover');
                    dropdown.hide();
                }
            });

        });

    };

    jQuery.fn.categoryMenu = function() {
        return $.each(this, function() {
            var root = $(this);

            var close = function() {
                root.find(">li").addClass("closed");
            };

            $(this).find(">li:not(.disabled)").hover(function() {
                close();
                var self = $(this);
                var subcats = self.find("div.subcats");
                var height = subcats.outerHeight();

                var top = self.position().top;
                var y = top + (self.outerHeight() / 2) - (height / 2);
                if (y + height > root.height() + ($.browser.msie ? 2 : 1))
                    y = root.height() - height + ($.browser.msie ? 2 : 1);
                if (y < 0)
                    y = 0;

                subcats.css("top", Math.ceil(y - top) + "px");
                self.removeClass("closed");

                return false;
            });

            $(this).find("div.subcats").each(function() {
                width = 0;
                $(this).find(">ul").each(function() {
                    width += $(this).innerWidth();
                });
                $(this).css("width", (width + 10) + "px");
            });

            close();

            $(this).bind("mouseleave", close);
        });
    };

    $.fn.notificationPopupAge = function(target) {
        var tar = $(this);
        var link = target;
        tar.appendTo($('#Form'));
        $(document).click(function(e) {
            if ($(e.target).attr('class').toString().match(link)) {
                e.preventDefault();
                tar.css({
                    left: ($(window).width() / 2) - (tar.width() / 2),
                    top: ($(window).height() / 2) - (tar.height() / 2)
                }).show();
            };

            tar.find('.closelink').live('click', function(e) {
                e.preventDefault();
                tar.hide();
            });
        });
    };

    $.fn.expandCells = function(selector) {

        return $(this).each(function() {
            var root = $(this);
            var links = root.find(selector);
            $(function() {
                links.each(function() {
                    var rows = root.find('.' + $(this).attr('openrows'));
                    !rows.hasClass('selected') ? rows.hide() : "";
                });
            });

            links.click(function(e) {
                e.preventDefault();
                root.find('.' + $(this).attr('openrows')).toggle();
            });
        });

    };

    $.fn.Terms = function(selector, hiddenfield, offSet, accepted) {
        var bottomOffset = offSet;
        var state = (accepted && accepted != "False") ? true : false;
        var readState = $(hiddenfield);
        return $(this).each(function() {
            if (!state) {
                var root = $(this);
                var attached = $(selector);
                attached.attr('disabled', 'disabled');
                root.bind('scroll', function() {
                    var scrollHeight = eval(parseInt(root[0].scrollHeight) - parseInt(root.height()));
                    var scrollTop = root[0].scrollTop;

                    if (scrollTop >= (scrollHeight - (bottomOffset ? bottomOffset : 30))) {
                        attached.add(attached.parent()).removeAttr('disabled');
                        readState.val('True');
                    }
                });
            }
        });
    };

    $.fn.termsOfUse = function(cb, state, offset) {
        var state = $(state);
        var cb = $(cb);
        if (cb.attr("checked") || state.val() == "1") {
            $(cb).attr("disabled", false);
            return this;
        }

        return $(this).each(function() {
            cb.attr("disabled", true);

            var update = function() {
                var targetTop = this.scrollHeight - $(this).innerHeight() - (offset || 30);

                if ($(this).scrollTop() >= targetTop) {
                    cb.attr("disabled", false);
                    state.val("1");
                    $(this).unbind("scroll");
                }
            };

            $(this).bind("scroll", update);
            update();
        });
    };

    $.fn.compactList = function(items) {

        return $(this).each(function() {
            var root = $(this);
            var textOut = textOut2 = finalText = textArray = '';
            var text = root.text().substring(root.text().search(':') + 1);
            finalText = root.text().substring(0, root.text().search(':') + 1);
            textArray = text.split(',');
            $.each(textArray, function(i) {
                i <= items ? textOut = textOut + textArray[i].toString() + "," : textOut2 = textOut2 + textArray[i].toString() + ",";
            });
            if (textOut2) {
                textOut2 = textOut2.slice(0, -1);
                textOut = textOut.slice(0, -1);
                finalText = finalText + textOut + ' <a href="#">Näytä kaikki</a><span class="moreNames">' + textOut2 + '</span>';
                root.empty().html(finalText);
                root.find('.moreNames').hide();
                root.find('a').bind('click', function(e) {
                    e.preventDefault();
                    var span = root.find('.moreNames').toggle();
                    span.is(':visible') ? $(this).text('Piilota') : $(this).text('Näytä kaikki');
                });
            }
        });
    };

    $.fn.playerstats = function() {
        return $(this).each(function() {
            var root = $(this), additional = $('.TournamentRoleTable, .tournamentresultsave'), isEdit = false, block = root.find('.playertypestatblock');
            block.find('.playertypestatblockcontent').add(additional).hide();
            block.find('h2 a').click(function(e) {
                e.preventDefault();
                var values = root.find('input:text, p.playerstatvalue').filter(function() { return ($(this).val() || $(this).text()); }).length,
                content = $(this).parents('.playertypestatblock').find('.playertypestatblockcontent');
                if (content.is(':visible') && !content.find('input:text, p.playerstatvalue').filter(function() { return ($(this).val() || $(this).text()); }).length) {
                    content.fadeOut('fast');
                    $(this).parents('.playertypestatblock').removeClass('blockToggled');
                } else {
                    content.fadeIn('fast');
                    $(this).parents('.playertypestatblock').addClass('blockToggled');
                }
                (isEdit || block.filter('.blockToggled').length || values) ? additional.fadeIn('fast') : additional.fadeOut('fast');
            });

            block.find('.clearFields a').click(function(e) {
                e.preventDefault();
                $(this).parent().parent().fadeOut('fast').parent().removeClass('blockToggled').find('input:text').each(function() { $(this).val(""); });
                var values = root.find('input:text, p.playerstatvalue').filter(function() { return ($(this).val() || $(this).text()); }).length;
                (isEdit || block.filter('.blockToggled').length || values) ? additional.fadeIn('fast') : additional.fadeOut('fast');
            });

            $(function() {
                block.each(function() {
                    if ($(this).find('input:text, p.playerstatvalue').filter(function() { return ($(this).val() || $(this).text()); }).length) {
                        $(this).addClass('blockToggled').find('.playertypestatblockcontent').fadeIn('fast');
                        additional.show();
                        isEdit = true;
                    }
                });
                if ($('p.playerstatvalue').filter(function() { return $(this).text(); }).length) {
                    $('.clearFields').hide();
                }
            });
        });
    };
	
	$.fn.ScrollToView = function() {
	    return $(this).each(function() {
	        var root = $(this);
	        window.scrollTo(0, root.offset().top);
	    });
	};
	
    $.fn.OneClickLogin = function() {
        return $(this).each(function() {
            var root = $(this), button = root.find('.loginbutton a'), inputs = root.find('input:text, input:password');
            
            function DisableButton() {
                
                if(button.parent().hasClass('bluebuttondisabled')) return false;

                if(button[0].href != "#") {
                    location.href = button[0].href;
                    button[0].href = "#";                    
                }

                button.parent().addClass('bluebuttondisabled');
                
                return false;                
            }

            inputs.keypress(function(e) {
                if(e.which == 13) {
                    DisableButton();
                    $(this).blur();
                }
            });

            button.click(DisableButton);
        });
    };

})(jQuery);

var flowplayerControlsOptions = {
    progressColor: '#797979',
    bufferColor: '#bbbbbb',
    buttonColor: '#a2a2a2',
    buttonOverColor: '#bdbdbd'
};

function SetUniqueRadioButton(nameregex, current)
{
  re = new RegExp(nameregex);
  for(i = 0; i < document.forms[0].elements.length; i++)
  {
        elm = document.forms[0].elements[i]
        if (elm.type == 'radio')
        {
              if (re.test(elm.name))
              {
                      elm.checked = false;
              }
         }
  }
  current.checked = true;
}

function InitDrillSequences(drillUrl, dId, sId, mediaUrl, thumbnail) {
    
    function requestSequenceData(drillId, sequenceId) {        
        var tabContents = $('#vpcontents .Avenla_TabbedPane_Content'), sequenceTabs = $('.SequenceTabs');
        $.ajax({
            url: drillUrl + "?drillId=" + drillId + "&sequenceid=" + sequenceId,
            dataType: "json",
            success: function (data) {
                var ul = $('<ul>').addClass('SequenceTabs');

                /* Navi */
                $('#videotabs .SequenceTabs, #videotabs .Avenla_TabbedPane_DynamicContentItem').remove();

                $.each(data, function (i, tab) {
                    var li = $('<li>'), a = $('<a>').attr('href', "#" + tab.Key.replace(' ', '_') + i).text(tab.Key).appendTo(li),
                        contentLi = $('<li>').addClass('Avenla_TabbedPane_ContentItem Avenla_TabbedPane_DynamicContentItem')
                            .attr('id', tab.Key.replace(' ', '_') + i).hide().html(tab.Value).appendTo($('#videotabs .Avenla_TabbedPane_Content'));
                    li.appendTo(ul);
                });

                $('#videotabs .Avenla_TabbedPane').prepend(ul);

                var tabLinks = $('#videotabs .SequenceTabs a'), allTabLinks = $('#videotabs .Avenla_TabbedPane_Tabs a');

                allTabLinks.each(function () {
                    $(this).parent().removeClass('Avenla_TabbedPane_ActiveTab');
                });

                allTabLinks.click(function () {
                    tabLinks.each(function () {
                        $(this).parent().removeClass('Avenla_TabbedPane_ActiveTab');
                    });
                    tabContents.find('li.Avenla_TabbedPane_ContentItem').hide();
                    var c = $($.trim(this.href.match(/#.+$/)));                    
                    c.show();
                });

                tabLinks.click(function (e) {
                    var tabLink = $(this);

                    allTabLinks.add(tabLinks).each(function () {
                        $(this).parent().removeClass('Avenla_TabbedPane_ActiveTab');
                    });

                    tabLink.parent().addClass('Avenla_TabbedPane_ActiveTab');

                    tabContents.find('li.Avenla_TabbedPane_ContentItem').hide();

                    var activeContent = tabContents.find(tabLink.attr('href')).show();

                    e.preventDefault();
                });

                tabLinks.add(allTabLinks).filter(':first').click();
            }
        });
    }

    function PopulateSequenceTabs(lnk) {
        var link = $(lnk), drillId = link.attr('data-drillid'), sequenceid = link.attr('data-sequenceid');

        requestSequenceData(drillId, sequenceid);
    }

    function fullscreenpicresize(ikh, ikw) {
        var ww = $(window).width(),
                    wh = $(window).height(),
                    isokuva = $('#FullPicContainer').find('img'),
                    scrolltop = $(window).scrollTop();

        $('#FullPicContainer').css({
            'width': ww,
            'height': wh,
            'z-index': '9999'
        });

        if (!ikh && !ikw) {
            var ikh = isokuva.height(),
                      ikw = isokuva.width();
        } else {
            $('#FullPicContainer').css({
                'top': scrolltop
            });
        }

        $('body').css({
            overflow: 'hidden',
            width: ww,
            height: wh
        }).addClass('asd');

        var winratio = ww / wh;
        var isoratio = ikw / ikh;

        if (winratio > isoratio) {
            isokuva.css({
                'height': wh,
                'width': 'auto'
            });
        } else {
            isokuva.css({
                'height': 'auto',
                'width': ww
            });
        }
    }

    function fullscreenpic(img) {

        var imgclone = img.clone();

        if (!$('#FullPicContainer').length)
            $('<div id="FullPicContainer"><div class="PicHolder"><img src=""/></div><a href="#" id="GoSmallPic">Takaisin</a></div>').appendTo('body');

        $('#FullPicContainer .PicHolder').empty().append(imgclone);

        var isokuva = $('#FullPicContainer .PicHolder').find('img');

        imgclone.hide();

        imgclone.bind('load', function () {
            fullscreenpicresize(imgclone.height(), imgclone.width());
            isokuva.show();
        });

    }

    function fullscreenexit() {
        $('#FullPicContainer').hide();
        $(window).unbind('resize');
        $('body').css({
            'overflow': 'auto',
            'width': '100%',
            'height': '100%'
        });
    }

    var root = $('.DrillSequences'), continueVideo = $('#ContinueVideo'), list = root.find('#DrillSequenceNav'), navLinks = list.find('li a');

    navLinks.click(function (e) {
        e.preventDefault();

        $(this).addClass('Active').parent().siblings().find('a').removeClass('Active');
        $('#PicHolder').show().find('img').attr('src', $(this).attr('href'));
        $('#ContinueVideo').show();

        PopulateSequenceTabs(this);

        if ($f())
            $f().pause();
    });

    continueVideo.click(function (e) {
        $('#PicHolder').hide();
        $(this).hide();
        navLinks.removeClass('Active');        

        if ($f())
            $f().play();
    });

    $('#FullPicContainer, #GoSmallPic').live('click', function (e) {
        e.preventDefault();
        fullscreenexit();
    });

    $('#GoFull').click(function (e) {
        if ($f())
            $f().toggleFullscreen();

        e.preventDefault();
    });

    list.hoverscroll({
        vertical: true,
        width: 150,
        height: 367,
        arrows: true,
        arrowsOpacity: 0.7,
        fixedArrows: false,
        rtl: false,
        debug: false
    });


    $('#GoFullPic').click(function (e) {
        e.preventDefault();
        fullscreenpic($('#PicHolder').find('img'));
        $('#FullPicContainer').show();
        $(window).bind('resize', function () {
            fullscreenpicresize();
        });
    });

    requestSequenceData(dId, sId);
}

$('#tournamentplayerstats .AddToTotal').live('keyup', function (e) {
    var row = $(this).parents('tr'), total = row.find('.Total'), fields = row.find('.AddToTotal'), sum = 0;

    fields.each(function () { sum += parseInt(this.value || 0); });

    if (!isNaN(sum))
        total.val(sum);
});

$(document).ready(function(){

   $('#ToolsContainer li').each(function() {
		var link = $(this).find('a.LinkDest').attr('href');
		$(this).click(function(){
			window.location = link;
		});
	});
    
    IIHCE.openDrillLink(location.href);
	
	/*
	$('.TournamentSummaryInfo ul li').hover(function () {
			$('.'+ $(this).attr('class')+'').css({'background' : '#fff'});
		}, function() {
			$('.'+ $(this).attr('class')+'').css({'background' : '0'});
			$('th.'+ $(this).attr('class')+'').css({'background' : '#efefef'});
			$('td.'+ $(this).attr('class')+'').css({'background' : '#f2f2f2'});
		});
	*/
});
