function ddBi_showShopErrorMessage(txError) {
    //ddBi_hidePopupMsgShop();
    $("ddBi_Cover").style.height = $("ddBi_mainContentRow").offsetHeight + "px";
    $("ddBi_Cover").style.display = "block";
    $("ddBi_validation_error").style.display = "block";
    $("ddBi_validation_errorMsg").innerHTML = txError;
    try {
        // $("ddBi_Cover").onclick = ddBi_hidePopupMsgShop;
        $("ddBi_Cover").onclick = ddBi_hidePopupMsg;
    } catch (ex) {
        // ignore
    }
}

function addArticle(btn) {
    if(callServer(btn, 'divWarenkorbKlein', 'addtocart()')) return true;
    var inp = document.getElementById("ddBi_box_548_UEsuchergebnis").getElementsByTagName("input");
    for (var i = 0; i < inp.length; i++) {
        if (inp[i].type == "text") inp[i].value = "";
    }
    return false;
}

function changeAmount(id, delta) {
    var inp = document.getElementById(id);
    if (!inp) return;
    var amount = parseFloat(inp.value);
    if (!amount) amount = 0;
    amount += delta;
    if(delta == 0.1 || delta == -0.1) amount = amount.toFixed(1);
    if (amount <= 0) amount = 0;
    inp.value = amount;
}

	function addtocart(){
			highlightNewAddedText(true);
	
	}
	var newAddedFadeOutTimer=false;
	var OpStart = Array();
			var OpEnd = Array();
			var OpMil = Array();
			var OpTimer = Array();
			var OpSpeed = Array();
			
	function changeOpac(opacity, id) {
		    var object = document.getElementById(id).style;
		    object.opacity = (opacity / 100);
		    object.MozOpacity = (opacity / 100);
		    object.KhtmlOpacity = (opacity / 100);
		    object.filter = "alpha(opacity=" + opacity + ")";
				
			}
			
		function fade_opacity(id, opacStart, opacEnd, millisec,mask,maskId,remove) {
				OpStart[id]=opacStart;
				OpEnd[id]=opacEnd;
				OpMil[id]=millisec;
		    OpSpeed[id] = Math.round(OpMil[id] / 100);
		    OpTimer[id] = 0;
		
		    if(OpStart[id] > OpEnd[id]) {
				  for(i = OpStart[id]; i >= OpEnd[id]; i--) {
						setTimeout("changeOpac(" + i + ",'" + id + "')",(OpTimer[id] * OpSpeed[id]));
	          OpTimer[id]++;
	        }			
		    } else if(OpStart[id] < OpEnd[id]) {
					for(i = OpStart[id]; i <= OpEnd[id]; i++) {
						setTimeout("changeOpac(" + i + ",'" + id + "')",(OpTimer[id] * OpSpeed[id]));
						OpTimer[id]++;
					}
				}
				
			}
	
	function highlightNewAddedText(callAct){
		if(newAddedFadeOutTimer && callAct){
			clearTimeout(newAddedFadeOutTimer);
			newAddedFadeOutTimer=false;
		}
		fade_opacity('ddBi_shop_newAddedToCart',((callAct) ? 0 : 100),((callAct) ? 100 : 0),650);
		fade_opacity('ddBi_shop_lastAddedToCart',((callAct) ? 100 : 0),((callAct) ? 0 : 100),650);
		/*document.getElementById("ddBi_shop_newAddedToCart").style.display=((callAct) ? "block" : "none");
		document.getElementById("ddBi_shop_lastAddedToCart").style.display=((callAct) ? "none" : "block");
		*/
		if(callAct){
			newAddedFadeOutTimer = setTimeout("highlightNewAddedText(false)",3500);
		}else{
			newAddedFadeOutTimer=false;
		}
	}
