	var carPos = 30;
	var t;
	var a;
	var kuda;
	function MoveMePlease(kuda) {
		if (kuda == 1) {
			document.getElementById('mr').style.width = '30px';
			if (carPos >= -1150) {
				t=setTimeout("MoveMePlease(1)", 40);
				carPos=carPos-10;
				writer(carPos);
			} else { clearTimeout(t); }
		}
		else if (kuda == 0) {
			document.getElementById('ml').style.width = '30px';
			if (carPos <= 20) {
				a=setTimeout("MoveMePlease(0)", 40);
				carPos=carPos+10;
				writer(carPos);
			} else { clearTimeout(a); }
		}		
	}
	function cleaner() { clearTimeout(a); clearTimeout(t); 
		document.getElementById('mr').style.width = ''; document.getElementById('ml').style.width = ''; 
		}
	function writer(newPos) { document.getElementById('lenta_in').style.left = newPos+'px'; }
 
 
function add_fr(id){
    $.get("/engine/ajax/friends.php", { id_friend: id, action: "add" } );
}


function doFriends(id,action, div) {
    var ajax = new dle_ajax();
    ajax.onShow('');
    var varsString = "id_friend=" + id;
    ajax.setVar("action", action);
    ajax.setVar("skin", dle_skin);
    ajax.requestFile = dle_root + "engine/ajax/friends.php";
    ajax.method = 'POST';
    ajax.element = div;
    ajax.sendAJAX(varsString)
};


function ChangeClass(id)
{
	id1 = id + '_b';
	id2 = id + '_c';	
	var el1 = document.getElementById(id1);
	var el2 = document.getElementById(id2);
	
	if (el2.className == 'Hide')
	{
		el1.className = 'bOpen';
		el2.className = 'Show';
		document.cookie = id + '=Show';	
        $('#news_title').html("<a href='/filmsnews/' onclick='return false;'>все новости</a> | скрыть");
	}
	else
	{
		el1.className = 'bShut';
		el2.className = 'Hide';			
		document.cookie = id + '=Hide';
        $('#news_title').html("<a href='/filmsnews/' onclick='return false;'>все новости</a> | показать");
	}	
}

$(function(){ 
    var r_m, m_m;

    r_m = $("#rightmaincolumn").height();
    m_m = $("#middlemaincolumn").height();
    if (m_m < r_m){
        r_m -= 100;
        $("#middlemaincolumn").height(r_m);
    }
    
    $(".menu_block").height($(".img_block").height()-110);
    $(".jcarousel-container-vertical").height($(".img_block").height()-110);
    
});
  
  /*  
    
    


    var cat_id;
    
    function mycarousel_itemLoadCallback(carousel, state)
{
    // Check if the requested items already exist
    if (carousel.has(carousel.first, carousel.last)) {
        return;
    }

    jQuery.get(
        '/engine/ajax/lenta.php',
        {
            first: carousel.first,
            last: carousel.last,
            cat_id: cat_id
        },
        function(xml) {
            mycarousel_itemAddCallback(carousel, carousel.first, carousel.last, xml);
        },
        'xml'
    );
};

function mycarousel_itemAddCallback(carousel, first, last, xml)
{
    var title = new Array, href = new Array;
    // Set the size of the carousel
    carousel.size(parseInt(jQuery('total', xml).text()));
    
    jQuery('title', xml).each(function(i) {
        title[i] = jQuery(this).text();
        });
    jQuery('href', xml).each(function(i) {
        href[i] = jQuery(this).text();
        });
        
    jQuery('image', xml).each(function(i) {
        carousel.add(first + i, mycarousel_getItemHTML(jQuery(this).text(), i, title[i], href[i]) );
    });
};

function mycarousel_getItemHTML(url, i, title, href)
{
    return '<a href="'+ href +'"><img id="img_'+ i +'" src="' + url + '" width="75" height="96" title="'+ title +'" alt="'+ title +'" /></a>';
};

jQuery(document).ready(function() {
    cat_id = jQuery('#cat_id').val();
    
       $('#mycarousel a').tooltip({ 
    track: true, 
    delay: 0, 
    showURL: false, 
    showBody: " - ", 
    fade: 250 
    });
    
    jQuery('#mycarousel').jcarousel({
        // Uncomment the following option if you want items
        // which are outside the visible range to be removed
        // from the DOM.
        // Useful for carousels with MANY items.

         //itemVisibleOutCallback: {onAfterAnimation: function(carousel, item, i, state, evt) { carousel.remove(i); }},
         size: 12,
         scroll: 1,
         wrap: "last",
         auto: 5,
         animation: "slow",
        itemLoadCallback: mycarousel_itemLoadCallback
    });
});
*/
/*
$(function(){

    var $el, leftPos, newWidth,
        $mainNav2 = $("#example-two");
    
    

    $mainNav2.append("<li id='magic-line-two'></li>");
    
    var $magicLineTwo = $("#magic-line-two");
    
    $magicLineTwo
        .width($(".current_page_item_two").width())
        .height($mainNav2.height())
        .css("left", $(".current_page_item_two a").position().left)
        .data("origLeft", $(".current_page_item_two a").position().left)
        .data("origWidth", $magicLineTwo.width())
        .data("origColor", $(".current_page_item_two a").attr("rel"));
                
    $("#example-two li").find("a").hover(function() {
        $el = $(this);
        leftPos = $el.position().left;
        newWidth = $el.parent().width();
        $magicLineTwo.stop().animate({
            left: leftPos,
            width: newWidth,
            backgroundColor: $el.attr("rel")
        })
    }, function() {
        $magicLineTwo.stop().animate({
            left: $magicLineTwo.data("origLeft"),
            width: $magicLineTwo.data("origWidth"),
            backgroundColor: $magicLineTwo.data("origColor")
        });    
    });
});*/