$(document).ready( function() {
	
	var optionsItemDetail = { 
		    target:     '#cart',
		    beforeSubmit: function() { 
			    // document.getElementById('waiting').style.display='';
			    // document.getElementById('addToCartButton').style.display='none';
			     $("#dialog-message").dialog( 'destroy' );
			    $("#dialog-message").dialog({
					modal: true,
					closeOnEscape: false,
					hide: 'highlight'
				});
			    
			    
		    } ,
		    success:    function() { 
			    // document.getElementById('waiting').style.display='none';
			    // document.getElementById('addToCartButton').style.display='';

			    	$("#dialog-message").dialog('close');
			    	 $('.ui-state-highlight').show( 'explode', {}, 500).delay(1000).hide('highlight',{},500);			    
//			     if (document.getElementById('addToCartButton').style.display!='block')
//			     {
//			     $('.ui-state-highlight').show( 'explode', {}, 500).delay(1000).hide('highlight',{},500);
//			     }
		    } 
		    
		}; 

		$(document).ready( function() {
			// bind 'myForm' and provide a simple callback function 
				$('.addToCart').ajaxForm( optionsItemDetail);
			});

 

 
	});
