$(document).ready(function(){

 
   var base = $('#base').html();
   var warning = $('#scriptwarning');
   warning.hide();
 
   
   
    /* delete cart contents with this session id */
    
    
   
       
    $("a.addcart").click(function(){         	
      id = this.title;
      
    
      
      addlink = $(this);
      deletelink = $(this).next('a');     
      $.post
      (base+"albums/ajaxadd",{picture: id}, function(data)
        {
        alert("Picture Added to Cart"); 
        $("#wed"+id).addClass('photoselected');        
         addlink.hide();
         deletelink.show();        
        }
      );     
      return false;     
    });    
    
    $("a.deletecart").click(function(){
    $(this).hide();   	
      id = this.title;
      
      deletelink = $(this);
      addlink = $(this).prev('a');
     
          
      $.post(base+"albums/ajaxdelete",{picture: id}, function(data)
      { 
        alert("Picture Deleted From Cart"); 
        $("#wed"+id).removeClass('photoselected');
        
         
         deletelink.hide();  
         addlink.show();
      
      });
      
      return false;     
    });
    
    
    $("a.emptycart").click(function(){
     
     $.post(base+"albums/ajaxempty",{}, function(data)
      { 
        alert("Cart Empty"); 
        $("div.wed-img").removeClass('photoselected');
        $('a.deletecart').hide();
        $('a.addcart').show();
        
         
         
      
      });
      
      return false;     
    });
    
    /*
    $().ajaxSend(function(r,s){$("#contentLoading").show();});   
    $().ajaxStop(function(r,s){$("#contentLoading").fadeOut("fast");});  
    */
    
    });
    
    
   

