
function showElement(objId) {
	if (document.getElementById(objId) != null) {
		document.getElementById(objId).style.visibility = 'visible';
	}
}

function hideElement(objId) {
	if (document.getElementById(objId) != null) {
		document.getElementById(objId).style.visibility = 'hidden';
	}
}

function getValue(id) {
	if (document.getElementById(id) != null) {
		if (document.getElementById(id).innerHTML != null && document.getElementById(id).innerHTML.toUpperCase() != 'UNDEFINED') {
			return document.getElementById(id).innerHTML;
		} else if (document.getElementById(id).innerText != null && document.getElementById(id).innerText.toUpperCase() != 'UNDEFINED') {
			return document.getElementById(id).innerText;
		}
	}
	return "";
}

function showButton(_id, _targetId,  _imgId, _linkId, _headerId, _textId, _windowName) {
		var so = new SWFObject("fileadmin/template/img/container.swf", _id, "213", "208", "6", "#aaffff");
		so.addParam("wmode", "transparent");
		so.addParam("name", "mid");
		so.addParam("swLiveConnect", "true");
		so.addVariable("vImage", getValue(_imgId));
		so.addVariable("vLink", getValue(_linkId));
		var hdr = getValue(_headerId).replace("<strong>", "<b>").replace("<STRONG>", "<b>");
		hdr = hdr.replace("</strong>", "</b>").replace("</STRONG>", "</b>");
		so.addVariable("vHeader", hdr);
		var txt = getValue(_textId).replace("<strong>", "<b>").replace("<STRONG>", "<b>");
		txt = txt.replace("</strong>", "</b>").replace("</STRONG>", "</b>");
    so.addVariable("vText", txt);
    so.addVariable("vWindowName", getValue(_windowName));
		so.write(_targetId);
	}
	
function includeFlash(_id, _targetId, _swf, _width, _height, _bgcolor ) {
		var so = new SWFObject(_swf, _id, _width, _height, "6", "#aaffff");
		so.addParam("wmode", "transparent");
		so.addParam("name", "mid");
		so.addParam("swLiveConnect", "true");
		so.write(_targetId);
	}
	
function setProductImage(imgUrl) {
    document.getElementById("productdetail").style.backgroundImage    = "url(" + imgUrl + ")";
  }

function checkPLZFinder(myForm) {
 if (myForm.plz.value=="") {
    alert("Bitte geben Sie mindestens die zwei ersten Stellen Ihrer Postleitzahl an.");
    return false;
 } else {
    return true;
 }
}

