
//send ajax request one by one.....this cancells the need for a queue.

//uses .manageAjax plugin to add extra functionality to ajax object.

// Manage type specifies how to deal with more then 1 request.


function _ajax(out, dest){
    
     $.ajax({
        
        method: "GET",
        url: '' + dest + '',
        beforeSend: function(){
	    if(out != "") {
           // $(out).hide();
	      $(out).html("<div class='loading'>loading...</div>"); //show the html inside .content div                  
	    }
        },
        
        complete: function(){
	    if(out != "") {

		$(".loading").html("done.....");
		$(".loading").hide("slow");
	    }
        },
        
        success: function(html){
	    if(out != "") {
        
		$(out).html(html); //show the html inside .content div 
		$(out).show('slow');
	    }
        }
        
        
        
    }); //close $.ajax( 
}

$(document).ready(function()
{

			  $('a.lightbox').lightBox({fixedNavigation:true});
			
			  $('#gallery td').mouseover(function() {
				      $(this).addClass('over');
			  });

			  $('#gallery td').mouseout(function() {
				      $(this).removeClass('over');
			  });

			 

			$("#show_hide").click(function() 
			{
				  
				  if($(this).attr('innerHTML') == "Close x")
				  {
				      $('#form_container').hide();
				      $(this).html('Subscribe Here >');
				  } else 
				  {
				      $('#form_container').show();
				      $(this).html('Close x');
				      _ajax('#form_container','/ignition_control/plugin_view/Mailhouse_subscriber/Form');
				  }
  
				  
			});
		    
});


  
