$('#ebay_insert_button').click(function() {

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

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

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

	var data = $(".ebay_tabreiter :input").serialize();

	//NOTE -> VARIATION ARTICLES ALWAYS CHECKED HERE -> SEE FILE overlay_call.js
	if(document.getElementById('nursofortkauf_check').checked){	
		$.ajax({
			//url: "php/ebay_api/php/ebay_insert_article.php",
			url: "php/ebay_api/ebaycalls/AddFixedPriceItem.php",
			type: "POST",
			data: data,
			success: function (text) {
			
			
			$("#message").html(text);
			//$('#popupBoxClose').show();
			$('#popupBoxClose').fadeIn('slow');
			$("#loader_ebay_insert_article").empty();
			}
		});

	}else {
		$.ajax({
			//url: "php/ebay_api/php/ebay_insert_article.php",
			url: "php/ebay_api/ebaycalls/AddItem.php",
			type: "POST",
			data: data,
			success: function (text) {
			
			
			$("#message").html(text);
			//$('#popupBoxClose').show();
			$('#popupBoxClose').fadeIn('slow');
			$("#loader_ebay_insert_article").empty();
			}
		});
	}	
return false;
			
});	
$('#popupBoxClose').click(function() {
	$("#message").empty();

});


	
	