var active_dress;

function dress_add(dress_id)  
 {  
	
		 $.ajax({  
	         type: "GET",  
	         dataType: "script",  
	         cache: false,  
	         url: 'ajax.php?action=dress_add&dress_id=' + dress_id,  
			
	         timeout: 3000,  
	         error: function (XMLHttpRequest, textStatus, errorThrown) {
				  // typically only one of textStatus or errorThrown 
				  // will have info
				  alert(XMLHttpRequest+' '+textStatus + ' ' +errorThrown);
				  this; // the options for this ajax request
				},  
	         success: function(data) {   
	             // Clear  
				$("#dress_added").html(data);
				$("#dress_added").fadeIn("slow");
				
	         }  
	     });  
	
 } 
 
 
function add_to_fav(){

var id = active_dress;

			//alert('ajax/?action=add_to_fav&id='+id);
				$.ajax({  
						 type: "GET",  
						 dataType: "text",  
						 cache: false,  
						 url: 'ajax/?action=add_to_fav&id='+id,  
						 //timeout: 3000,  
						 error: function (XMLHttpRequest, textStatus, errorThrown) {
							  // typically only one of textStatus or errorThrown 
							  // will have info
							  alert(textStatus + ' ' +errorThrown);
							  this; // the options for this ajax request
							},  
						 success: function(data) {   
							 // Clear  
							
							alert(data); 
							 
						 }  
					 });  
			
				return false;
}

function rem_from_fav(){

var id = active_dress;

			//alert('ajax/?action=rem_from_fav&id='+id);
				$.ajax({  
						 type: "GET",  
						 dataType: "text",  
						 cache: false,  
						 url: 'ajax/?action=rem_from_fav&id='+id,  
						 //timeout: 3000,  
						 error: function (XMLHttpRequest, textStatus, errorThrown) {
							  // typically only one of textStatus or errorThrown 
							  // will have info
							  alert(textStatus + ' ' +errorThrown);
							  this; // the options for this ajax request
							},  
						 success: function(data) {   
							 // Clear  
							
							$('a[alt='+id+']').parent().remove();
							alert(data); 
							 
						 }  
					 });  
			
				return false;
}
