$(document).ready(function(){

/*Still needs intialiseation*/
$("a[rel^='prettyPhoto']").prettyPhoto({
			animation_speed: 'normal',
			show_title: true, 
			theme: 'facebook',
			social_tools: false
});

$("a[rel^='prettyPhoto']").live("click",function(){

$.prettyPhoto.open($(this).attr("href"),'',$(this).attr("title"));

return false;
});


});

$(document).ready(function(){
	$("#show_l_c").click(function(){
	$("#l_comments").css('display', 'block');
	$("#l_forum").css('display', 'none');
	return false;
	});

	$("#show_l_f").click(function(){
	$("#l_comments").css('display', 'none');
	$("#l_forum").css('display', 'block');
	return false;
	});
	});

function mycarousel_itemLoadCallback(carousel, state)
{
    // Check if the requested items already exist
    if (carousel.has(carousel.first, carousel.last)) {
        return;
    }

    jQuery.get(
        'http://www.pokermoscow.ru/index2.php?option=com_waitinglist&task=pokermoscow_tv&id=666&no_html=1',
        {
            first: carousel.first,
            last: carousel.last
        },
        function(xml) {
            mycarousel_itemAddCallback(carousel, carousel.first, carousel.last, xml);
        },
        'xml'
    );
};

function mycarousel_itemAddCallback(carousel, first, last, xml)
{
    // Set the size of the carousel
    carousel.size(parseInt(jQuery('total', xml).text()));

    jQuery('video', xml).each(function(i) {
        carousel.add(first + i, jQuery(this).text());
    });
};

jQuery(document).ready(function() {

    jQuery('#video').jcarousel({
       // itemVisibleOutCallback: {onAfterAnimation: function(carousel, item, i, state, evt) { carousel.remove(i); }},
        itemLoadCallback: mycarousel_itemLoadCallback
    });
});

function getVideo(id)
{
    $(document).ready(function(){
    $.ajax({
    url: "http://www.pokermoscow.ru/index2.php?option=com_waitinglist&task=pokermoscow_tv&id=" + id + "&no_html=1",
    cache: false,
    beforeSend: function() {
    },
    success: function(html){
    }
    });
    return false;
    });
}

function getContent(button, loader, div, block, action, cookie)
{
    $(document).ready(function(){
    $.ajax({
    url: "http://www.pokermoscow.ru/index2.php?option=com_waitinglist&task=index&date=" + $.cookie(cookie) + "&block=" + block + "&action=" + action + "&no_html=1",
    cache: false,
    beforeSend: function() {
    $(loader).html('<img src="http://www.pokermoscow.ru/templates/idv_PM/img/ajax-loader.gif" alt="" />');
	$(div).fadeTo("normal", 0.3);
    },
    success: function(html){
	$(loader).html('');
    $(div).html(html);
	$(div).fadeTo("normal", 1);
    }
    });
    return false;
    });
}

//<Покер онлайн>
jQuery(document).ready(function() {
    jQuery('#poker_online').jcarousel({
        vertical: true,
        scroll: 1
    });
});
//</Покер онлайн>
