$(document).ready(function(){
    //$('ul.sub_menu li ul').hide();    
	$('ul.sub_menu li ul').show();    
	$('ul.sub_menu li a').css({'border-bottom':'none'});
	$('ul.sub_menu li ul li a.current').parent().parent().show();
	$('ul.sub_menu li.current').addClass("active");
	$('ul.sub_menu > li:has(ul) > a').click(function() {
		$(this).find('ul').stop(true, true);
		$(this).parent().find('ul').slideToggle();
		$(this).parent().toggleClass("active");
		return false;
		}
	 );

	//nav_page
		$('.middle #nav_page a:eq(1)').css({'background':'none'});
	//nav_page end


	//avtorization
    $("#form_autorization").hide();
	$(".say_something").click(function(){
		$("#form_autorization").slideToggle();
		$(this).toggleClass("active");
		return false;
	});
	//avtorization_end

   	//table
	$("table.design tr").css({'background':'#f1efe8'});
	$("table.design tr").hover(function() {
    	$(this).stop().css({'background':'#fff'});
        } , function() {
		$(this).stop().css({'background':'#f1efe8'});
	});
   	//table_end
	$(".price .clearfix").hover(function() {
    	$(this).stop().css({'background':'#F1BC26'});
        } , function() {
		$(this).stop().css({'background':'none'});
	});
    //end price


});


//style links
$(document).ready(function() {
	$('a[class$=xls]').append('<img src="/images/xls.png" alt=""/>');
	$('a[class$=doc]').append('<img src="/images/word.png" alt=""/>');
	$('a[class$=DOC]').append('<img src="/images/word.png" alt=""/>');
	$('a[class$=pdf]').append('<img src="/images/pdf.png" alt=""/>');
	$('a[class$=ttf]').append('<img src="/images/xls.png" alt=""/>');
});


//fancybox
$(document).ready(function() {
	$("a[rel=group]").fancybox({
		'titlePosition'		: 'outside',
		'overlayColor'		: '#000',
		'overlayOpacity'	: 0.9,
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over2">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
		}
	});
		$("a[rel=c]").fancybox({
	});
});
//fancybox_end



$(document).ready(function() {
$('.foto_img li').hover(
                function () {
                    var $this = $(this);
                    $this.find('img')
                    .stop()
                    .animate({'opacity':'1.0'},400);
                },
                function () {
                    var $this = $(this);
                    $this.find('img')
                    .stop()
                    .animate({'opacity':'0.3'},400);
                }
            );
});


/*$(document).ready(function() {
	anchor.init()
});

anchor = {
	init : function() {
		$("a.anchorLink").click(function () {
		elementClick = $(this).attr("href")
		destination = $(elementClick).offset().top;
		$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, 1100 );
		return false;
		})
	 }
} */





