// Simple JQuery Collapsing menu. web: http://www.i-marco.nl/weblog/ 
function initMenu() {
  $('#menu ul').hide();
  $('#menu li a').click(
    function() {
        $(this).next().slideToggle('normal');	
      }
    );
  }
$(document).ready(function() {initMenu();});


function Setclasslimenu(id)
{
	var element = document.getElementById(id);
	if(element.className == '')
	{
	element.className = 'on_li_menu';
	}
	else
	element.className = '';
}

$(document).ready(function() {
// Добавлено декабрь 09
$(".opa").hover(function () {$(this).fadeTo("fast", 0.7);},
  function() {$(this).fadeTo("fast", 1);});
// Для поиска						   
$('#search_ex_, #ex_hide').click(function(){
$('#search_ex_, #search_ex').toggle();
										  });
$('#search_ex p').click(function(){
$('#search_ex p').addClass("decor");
$(this).removeClass("decor");
$('#search_ex input').val($("#search_ex p").index(this));
								 });
// надписи в полях инпут
$('input.q').focus(function(){
ds_value = $(this).val();
$(this).val('');
							});

$('input.q').blur(function(){
if ($.trim($(this).val()) == "") $(this).val(ds_value);
							});


// для полей паролей

$('span.password').click(function(){
$(this).next().focus();
})

$('input.password').focus(function(){
if($(this).val() == ' ') $(this).val(''); // для хрома, чтоб лишние символы убрать
$(this).prev().hide();								   
								  });
$('input.password').blur(function(){
if($.trim($(this).val()) == '') {
	
	$(this).val('');
	$(this).prev().show(); 		}
								  });

$('.sfull span').click(function(){
$('.sfull span').addClass("decor");
$(this).removeClass("decor");								
$('.sfull input').val($(".sfull span").index(this));								
								});
$('.stype span').click(function(){
$('.stype span').addClass("decor");
$(this).removeClass("decor");
$('.stype input').val($(".stype span").index(this));								
								});
// при загрузке назначаем отметки в поисковой форме
var s_full = $('.sfull input').val();
var s_type = $('.stype input').val();
$('.sfull span, .stype span').addClass("decor");
$('.sfull span').eq(s_full).removeClass("decor");
$('.stype span').eq(s_type).removeClass("decor");
// Добавлено янв. 10
// Для добавления уроков в закладки
$('#favorite').click(function(){
$(this).addClass('sendf');
$(this).children('img').show();
$(this).children('span').html('&nbsp;Работаю...');
$.post(
"add_favorite.php",
{lesUrl:encodeURI(location)}, 
function(data){
	$('#favorite').removeClass('sendf');
	$('#favorite img').hide();
	$('#favorite span').html(data);
	$('#favorite').unbind();
	}
	   )
							  });

//  в комментах
	$("#add_userjob, #add_screen").live('click', function(){
	addfilefield('to_add', $(this).attr('id'));
	return false
	});	

// * регистрация с сайта * // 

						   });