
	
	function getVersandLand() {
    		return jQuery.get('./shipcountry.php').responseText;
   	 }

		
		var timeout;

		
		function showLoading(htmlid, loadingimg) {
			document.getElementById(htmlid).src = loadingimg;
		}
		
		function hideLoading(htmlid, hideimg) {
			document.getElementById(htmlid).src = hideimg;
		}
		
		function showCart(qty) {
			var $j = jQuery.noConflict();
			$j('#message_cart').show('fast');
			if (timeout!=null)
				window.clearTimeout(timeout);

			timeout = setTimeout("jQuery.noConflict()('#message_cart').hide('slow')",7000);
		}
		
		function reloadCart() {
			jQuery.noConflict()('#cart_box_parent').load('./getcartcontent.php').hide().fadeIn('fast');
			
		}
		
		function reloadCartSite() {
			jQuery.noConflict()('#content_div').load('./getmaincartcontent.php').hide().fadeIn('fast');
		}
	
		function addToCartBackgroundAdvanced(imgid, articleid, qty2) {
			var cart_mess = document.getElementById('message_cart');
			cart_mess.style.position = 'fixed';
			cart_mess.style.bottom = '0px';
			cart_mess.style.width = '736px';
			showLoading(imgid, '/templates/xt_default/img/ajax-loader-list.gif');
			jQuery.post("/", {action: "add_product", product: articleid, qty: qty2}, function (data, textStatus) {
	   			reloadCart();
	   			hideLoading(imgid, '/templates/xt_default/img/buttons/de/button_in_cart.png');
				showCart(0);		
			});

		}
	
		function removeFromCart(key) {
			jQuery.ajax({
				url: '?action=update_product&page=cart&products_key[0]='+key+'&qty[0]=0',
				async: false,
				success: function() {
					reloadCart();
					location.reload();			
				}	
				});
		}
		
		
	function addToCartBackground(imgid, articleid, qty2, customhash, customdata) {
		showLoading(imgid, '/templates/xt_default/img/ajax-loader.gif');
		var url_data = "action=add_product&product=" + articleid + "&qty=" + qty2;
		if (customhash != "") {
			jQuery.post("/", 
					{action: "add_product", 
					product: articleid, 
					qty: qty2, 
					custom_hash: customhash, 
					custom_product: customdata
					}, 
					function (data, textStatus) {
	   			reloadCart();
	   			hideLoading(imgid, '/templates/xt_default/img/buttons/de/button_warenkorb_klein.png');
				showCart(0);
				location.reload();			
			});
		}else {
			jQuery.post("/", {action: "add_product", product: articleid, qty: qty2}, function (data, textStatus) {
	   			reloadCart();
	   			hideLoading(imgid, '/templates/xt_default/img/buttons/de/button_warenkorb_klein.png');
				showCart(0);			
			});
		}
			
	}