//no conflict jquery
jQuery.noConflict();
//jquery stuff
(function($) {
    $(document).ready(function(){
        $("#forgotpassword-link").colorbox({width:"50%", inline:true, href:"#div-forgotpassword", title:"", scrollbars: false});

        $("#forgotpassword-form").validate({
            submitHandler: function(form) {
                $(form).ajaxSubmit({
                    target: "#forgotpassword-result",  
                    beforeSubmit: function(){
                         $(".loading").removeClass("hidden");
                    },      
                    success:    function() { 
                        $(".loading").addClass("hidden");
                        $.fn.colorbox.resize();
                        $("#forgotemail").val("");
                    } 
                });
            },
            rules: {
                forgotemail: {
                    required: true,
                    email: true
                }
            },
            messages: {
                forgotemail: {
                    required: "Ange epostadress",
                    email: "Ange korrekt epostadress"
                }
            }
        });       

    });
})(jQuery);
 
