function showLoginForm(){
    $("#loginBox").stop(true,true).slideDown(350);
} 
function hideLoginForm(){
    $("#loginBox").stop(true,true).slideUp(350);
}

jQuery(function(){
    $(".csmonitor_tt").toggle(function(){
        id_block=$(this).attr("id");
        $("#m_"+id_block).stop(true,true).show(350);
    },
    function(){
        id_block=$(this).attr("id");
        $("#m_"+id_block).stop(true,true).hide(350);
    })
    
    $("#view_title").toggle(function(){
        $(".show_main").stop(true,true).hide(350);
    },
    function(){
        $(".show_main").stop(true,true).show(350);
    })
    
//	$(".accordion h3:first").addClass("active");
	//$(".accordion p:not(:first)").hide();
 
	$("#servers_menu a.servers_menu_a").click(function(){
		$(this).next("div").slideToggle("slow").siblings("div:visible").slideUp("slow");
	});
    
   $(".genre_list a.op_list").click(function(){
        $(this).next("div").slideToggle("slow").siblings("div:visible").slideUp("slow");
    });
    
})

$(document).ready(function(){
    var options = { 
    target: "#profile_informer",
    beforeSubmit: showRequest,
    success: showResponse,
    timeout: 3000
    };
      
    $('#regForm').submit(function() { 
        	$(this).ajaxSubmit(options);  
            return false;
      }); 
});

function showRequest(formData, jqForm, options) { 
    var queryString = $.param(formData); 
    return true; 
} 
 
function showResponse(responseText, statusText){ 
    switch (responseText){ 
        case "upd_ok":
            $("#profile_informer").stop(true,true).slideDown(350).addClass('profile_informer_ok');
            $(".profile_form").slideUp(450);
            $("#profile_informer").html("Обновились! Для завершения нажмите <a href='/profile/update'><strong>сюда</strong></a>");
        break;
        case "reg_ok":
            $("#regForm").slideUp(450);
            $("#profile_informer").css('display','none');
            $("#reg_ok").html("Ура! Регистрация на портале завершена успешно! &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;<img src='http://forum.game.uz/style_emoticons/default/to_become_senile.gif' alt='' /><br/>Проверьте ваш регистрационный e-mail для получения пароля.").slideDown(350);
            $("#reg_ok").append("<p><a href='/reviews/'>Обзоры</a> | <a href='/news/'>Новости</a> | <a href='/games/'>Игры</a> | <a href='/servers/'>Сервера</a> | <a href='/screenshots/'>Скриншоты игр</a></p>");
        break;
        case "pass_ok":
            $("#profile_informer").stop(true,true).slideDown(350).addClass('profile_informer_ok');
            $(".profile_form").slideUp(450);
            $("#profile_informer").html("На Ваш E-mail адрес был выслан Новый пароль. Для завершения операции нажмите <a href='/'><strong>сюда</strong></a>");
        break;
        case "fd_ok":
            $("#profile_informer").stop(true,true).slideDown(350).addClass('profile_informer_ok');
            $(".profile_form").slideUp(450);
            $("#profile_informer").html("Ваше сообщение было успешно отправлено");
        default:
            $("#profile_informer").stop(true,true).slideDown(350);
        break;
    }
}