$(document).ready(function() { $('.asearch_btn').live('click', function() { $('div#asearch').before('
').parent().find('.asearch_ajax_loader').fadeIn(50); $('div#asearch').animate({'opacity':0.8},100,function () { $.ajax({ type:'POST', data:'&text='+$('.asearch_text').val(), url:'/asearch/', success:function(data) { $('.asearch_ajax_loader').stop().animate({'opacity':0},100,function() { $(this).remove(); }); if(data=='') return false; $('div#asearch').html(data).animate({'opacity':1},100, function() { $(this).slideDown(200); start_gallery(); }); } }); }); return false; }); $('a.asearch_nav').live('click', function() { var obj = this; var href = $(this).attr('href'); var t = href.split('/'); $(obj).after('').parent().find('.asearch_ajax_loader').fadeIn(50); $('div#asearch_ajax_'+t[2]).stop().animate({'opacity':0.8},100); $.ajax({ type:'POST', data:'&text='+$('#asearch_orig_phrase').html(), url:href, success:function(data) { $('div#asearch_ajax_'+t[2]).parent().find('.asearch_ajax_loader').stop().animate({'opacity':0},100,function() { $(this).remove(); }); $('div#asearch_ajax_'+t[2]).stop().animate({'opacity':1},100, function() { $(this).replaceWith(data); start_gallery(); }); //alert(data); } }); return false; }); }); //CSS LOAD $("head").append(""); css = $("head").children(":last"); css.attr({ rel: "stylesheet", type: "text/css", href: "/asearch/mf/asearch.css" });