jQuery.noConflict();
(function($) { 		  
		  
  $(function() {	
				
		// Loggin 
		$('a.loggin').click(function (e) {
			e.preventDefault();
			$('#basic-modal-content').modal();
		});

		var loader = jQuery('<div id="loader"><img src="loading.gif" alt="loading..." /></div>')
			.css({position: "absolute", top: "19em", left: "8em"})
			.appendTo("body #basic-modal-content")
			.hide();
		jQuery().ajaxStart(function() {
			loader.show();
		}).ajaxStop(function() {
			loader.hide();
		}).ajaxError(function(a, b, e) {
			throw e;
		});
		
		var v = jQuery("#prof").validate({
			submitHandler: function(form) {
				jQuery(form).ajaxSubmit({
					target: "#result"
				});
			}
		});
		
		

		// Favoriter
		$(".love").click(function() {					  
			var id = $(this).attr("id");
			var dataString = 'id='+ id;
			var parent = $(this);
			//alert(dataString);
			$(this).fadeOut(300);
			$.ajax({
				type: "POST",
				url: "/ajax_text.php",
				data: "id="+id,
				cache: false,
				success: function(html) {
					parent.html(html);
					parent.fadeIn(300);
				} 
			});	
			return false;
		});		
	
		$(document).ready(function() {
			$("span.on_img").mouseover(function () {
				$(this).addClass("over_img");
			});
		
			$("span.on_img").mouseout(function () {
				$(this).removeClass("over_img");
			});
		});



		$('#add_adr').hide();
		$('a#add-hide').click(function() {
			$('#add_adr').hide('fast');
			return false;
		});
		$('a#add-toggle').click(function() {
			$('#add_adr').toggle(250);
			return false;
		});


		// Add feed
		// feed_add
		$("span.btn_add").mouseover(function () {
			$(this).addClass("btn_cancel");
		});
		$("span.btn_add").mouseout(function () {
			$(this).removeClass("btn_cancel");
		});


		$('#feed_add').hide();
		$('.add_feed').click(function() {
			$('#feed_add').slideToggle(250);
			return false;
		});		

		
        var hide = false;
        $("#choose_profile").hover(function(){
            if (hide) clearTimeout(hide);
            $(".choose_profile").fadeIn();
        }, function() {
            hide = setTimeout(function() {$(".choose_profile").fadeOut("slow");}, 250);
        });
        $(".choose_profile").hover(function(){
            if (hide) clearTimeout(hide);
        }, function() {
            hide = setTimeout(function() {$(".choose_profile").fadeOut("slow");}, 250);
        });

  });

})(jQuery);