$('#ebay_getorders_button').click(function(	) {
	
			// When site loaded, load the Popupbox First
		$('#popupBoxClose_order').hide();
		loadPopupBox();
	
		$('#popupBoxClose_order').click( function() {			
			unloadPopupBox();
		});
		
		$('#container').click( function() {
			unloadPopupBox();
		});

		function unloadPopupBox() {	// TO Unload the Popupbox
			$('#popup_box_table').fadeOut("slow");
			$("#container").css({ // this is just for style		
				"opacity": "1"  
			}); 
		}	
		
		function loadPopupBox() {	// To Load the Popupbox
			$('#popup_box_table').fadeIn("slow");
			$("#container").css({ // this is just for style
				"opacity": "0.3"  
			}); 		
		}
		/**********************************************************/

	$("#loader_ebay_getorders").empty().html('<img src="php/ebay_api/gfx/ladebild_klein.gif" />');
	

	var data = {
		'id': $(this).val() // LEX_ID FROM DETAILBUTTON
	}
			
				$.ajax({
					url: "php/ebay_api/ebaycalls/getorders.php",
					type: "POST",
					data: data,
					success: function (data) {
					
					
					//$('#popupBoxClose').show();
					$('#popupBoxClose_order').fadeIn('slow');
					$("#loader_ebay_getorders").empty();
					

						$.get("php/ebay_api/php/order_switchto_neu.php", function(html) {
						$("#tbody").empty();
		
						$("table tbody").append(html);
						var resort = true;
						$("table").trigger("update", [resort]);
						$("table").trigger("sorton", [ [[0,1]] ]);
						});	
					}
		});
return false;
			
});		
$('#popupBoxClose_order').click(function() {
	$("#message_order").empty();  
});	