var C = {
	//-
	faq: {
		init: function()  {
			$('dd.answer').css('display', 'none');
			$('.faq_link').click(function() {
				item_id=$(this).attr('id');
				item_id=item_id.substr(4);
				C.faq.showHide(item_id);
				return false;
			})
		},
		showHide: function(item_id) {
			var id = '#answer' + item_id;
			var link_id = "#faq_" + item_id;
			if ($(id).css('display') == 'none') {
				//$(id).show('slow');
				//$(id).slideDown('fast');
				$(id).slideDown('fast',function(){
					$(this).css("border-bottom", ".3em #E6E7DA solid")
					$(this).css("margin-bottom", "1em")
					});
				$(link_id).addClass("active");
			} else {
				//$(id).hide('slow');
				$(id).slideUp('fast');
				$(link_id).removeClass("active");
				}
			}
		},
	// -   
	newarchive: {
		init: function()  {
			$('.arch>li').click(function() {
				$('.arch>li').removeClass('hovered');
				$(this).addClass('hovered');
				return false;
			}, function() {
				$(this).removeClass('hovered');
				$('#thisyear').addClass('hovered');
				return false;
			});
		}
	}
}




/*after all*/
jQuery.fn.hint = function () {
	return this.each(function (){
	var t = jQuery(this);
	var title = t.attr('title');
	if (title) {
		t.blur(function (){
			if (t.val() == '') {
				t.val(title);
				t.addClass('blur');
		}
	});
	t.focus(function (){
		if (t.val() == title) {
			t.val('');
			t.removeClass('blur');
		}
	});
	t.blur();
	}
	});
}




/* 
============================================
Accordion menu
Author:Kamil Kashaev [http://kashaev.ru]
Created date:06.02.2007 20:29 
==============================================
*/

function initMenu() {
	var	menu = ".mmnu ul";
		cur = "active";

	$(menu).find('ul').hide();
	$(menu).find('a.activeLink').parents("ul").show();

	$(menu).find('li a').click(function(){
		var th = this;
			checkElement = $(th).next();
			thParent = $(th).parent();

		if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
			return false;
			}
		if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
			$(menu).find('ul:visible').slideUp('fast');
			
			checkElement.slideDown('fast');
			
			thParent.addClass(cur);
			thParent.siblings().removeClass(cur);
			
			return false;
			}
		});
	}




$(document).ready(function() {

	initMenu();
	//  ,   ,   "after all"
	$('input[title!=""],textarea[title!=""]').hint();

});

