$(function() {

	var speed = 400;
	$('ul#my-menu ul').each(function(i) { // Check each submenu:
		$(this).prev().addClass('collapsible').click(function() { // Attach an event listener
			var this_i = $('ul#my-menu ul').index($(this).next()); // The index of the submenu of the clicked link
			if ($(this).next().css('display') == 'none') {
				
				// When opening one submenu, we hide all same level submenus:
				$(this).parent('li').parent('ul').find('ul').each(function(j) {
					if (j != this_i) {
						$(this).slideUp(speed, function () {
							$(this).prev().removeClass('expanded').addClass('collapsed');
						});
					}
				});
				// :end
				
				$(this).next().slideDown(speed, function () { // Show submenu:
					$(this).prev().removeClass('collapsed').addClass('expanded');
				});
			}else {
				$(this).next().slideUp(speed, function () { // Hide submenu:
					$(this).prev().removeClass('expanded').addClass('collapsed');
					$(this).find('ul').each(function() {
						$(this).hide().prev().removeClass('expanded').addClass('collapsed');

					});
				});
			}
		return false; // Prohibit the browser to follow the link address
		});
	});
	
	
	var speed2 = 200;
	$('.sample-menu .a').hover(
		function(){
			$(this).stop().animate({ paddingRight: "22px" }, 200);
		},
		function(){
			$(this).stop().animate({ paddingRight: "12px" }, 200);
		}
	);

	
	var tmp = '';
	$('.little_img').hover(
		function(){
			$(this).parent().find('span').css('display', 'none');
			$(this).find('span').fadeIn(400);
			$('#big_img_2').attr('src', $(this).find('img').attr('src'));
			$('#big_img_1').fadeOut(400);
			
tmp = $(this).find('img').attr('src');

			setTimeout(function(){
				$('#big_img_1').attr('src', tmp);
				$('#big_img_1').fadeIn(1);
		}, 400);
		},
		function(){
		}
	);
	
	
	$('.table td table td div').hover(
		function(){
			$(this).find('.pop_up').css('display', 'block');
		},
		function(){
			$(this).find('.pop_up').css('display', 'none');
		}
	);	
	
	
});

function show_ol_info(obj){
        if($(obj).parent().find('.ol_info').css('display') == "none"){
                $('#content_right li a').css('textDecoration', 'underline');
                $(obj).css('textDecoration', 'none');
                $(obj).parent().parent().find('.ol_info').slideUp('100');
                $(obj).parent().find('.ol_info').slideDown('100');
        } else {
                $(obj).parent().parent().find('.ol_info').slideUp('100');
        }
        return false;
}
