$('img#btnpreview').live('click', function () {
    $('#b_right_userblockpreview').empty();
    $('#b_right_userblockpreview').html($('textarea#editUserText').val());
});

$(document).ready(function()
{
    Shadowbox.init();
    $("#mp_slider").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true);

    if($('#rega_pics_wait').length > 0 )
    {
        $('#rega_pics_wait').css('display', 'none');
        $('#rega_pics').css('display', 'block');
    }

    $('#subtab a.sub').live('click', function(d){
        d.preventDefault();
        var sTab = $(this).attr('rel');
        $('div.subtab_tab').css('display', 'none');
        $('div#'+sTab+'div').css('display', 'block');
        $('#subtab a').css('border', 'none');
        $(this).css('border-bottom', '1px dotted #9f3b3b')
    });

    $('tr.showreview').live('click', function(d){
        d.preventDefault();
        if ($(this).children('td.link').length > 0)
            window.location.href = $(this).children('td.link').children('a').attr('href');
    });

    $('#galdialog').dialog({
    	show: "blind",
        height: 500,
        width:600,
        closeOnEscape: true,
        modal: true,
        resizable: false,
        autoOpen: false
    });

    $('div#smgal').mouseenter(function() {
        $('#smgalinone').css('display','none');
        $('#smgalintwo').css('display','block');
        $('div#smgal').css('cursor','pointer');
    }).mouseleave(function() {
        $('#smgalinone').css('display','block');
        $('#smgalintwo').css('display','none');
        $('div#smgal').css('cursor','default');
    });

    $('div#smgal').live('click', function(d){
        d.preventDefault();
        window.location.href = $('a#smgalinlink').attr('href');
    })

    $('tr.showreview').mouseover(function() {
        $(this).css('background-color','#4E4E4E').css('cursor', 'pointer');
    }).mouseout(function(){
        $(this).css('background-color','#1D1D1D').css('cursor', 'default');
    });



    $(function() {
        $('#accordion').accordion({
			autoHeight: false,
			navigation: true,
            collapsible: true
		});
	});




});
