$(document).ready(function(){ 
    
$(function() {

	$( "#logindialog" ).dialog({
		autoOpen: false,
		show: 'fade',
		hide: 'fade',
		width: 300
	});

	$('#loginlink').click(function(){
		$('#logindialog').dialog('open');
		return false;
	});
});

$(function() {

	$( "#polldialog" ).dialog({
		autoOpen: false,
		width: 450
	});

	$('#polllink').click(function(){
		$('#polldialog').dialog('open');
		return false;
	});
});

$(document).ready(function(){
		$('#topmenu li.sublnk').hover(
		function() {
			$(this).addClass("selected");
			$(this).find('ul').stop(true, true);
			$(this).find('ul').show('fast');
		},
		function() {
			$(this).find('ul').hide('fast');
			$(this).removeClass("selected");
		}
	);
});

$(function () {
	$(".lcomment:odd").addClass("even");
	$(".lcomment").hover(function(){ $(this).addClass("hover");},function(){$(this).removeClass("hover");});
	$('.lcomment').click(function(){window.location=$(this).find("a").attr("href"); return false;});
	});



/*$(function(){
	$("#gallery").preloader({
							stop: 'true',
							
							});
	});*/
    
$('#story').focus(function(){
    if($(this).val()=="Поиск по сайту..."){
        $(this).val('');
        }
}).blur(function(){
    if($(this).val()==""){
        $(this).val('Поиск по сайту...');
        }
});

$("#vote_golosov").addClass('bbcodes_poll').hover(function(){
    $(this).animate({
	    'color': '#A0C6DE'
       
    },500);
}, function() {
    $(this).animate({
        'color': '#ffffff'
    },500);
});

$("#lenta_hover img").mouseover(function(){
    $(this).animate({
	    'opacity': '0.7',       
    },200);
}).mouseout(function() {
    $(this).animate({
       'opacity': '1',
       
    },200);
});

$.fx.speeds._default = 1000;
	$(function() {
		$( "#dialog" ).dialog({
			autoOpen: false,
            width: 390,
                                                
		});

		$( "#opener" ).click(function() {
			$( "#dialog" ).dialog( "open" );
			return false;
		});
	});
    




});
