function fixPNG(myImage)
{
  arVersion = navigator.appVersion.split("MSIE");
  version = parseFloat(arVersion[1]);

    if ((version >= 5.5) && (version < 7) && (document.body.filters))
    {
      var imgID = (myImage.id) ? "id='" + myImage.id + "' " : "";
   var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : "";
   var imgTitle = (myImage.title) ?
              "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' ";
   var imgStyle = "display:inline-block;" + myImage.style.cssText;
   var strNewHTML = "<span " + imgID + imgClass + imgTitle
                 + " style=\"" + "width:" + myImage.width
                 + "px; height:" + myImage.height
                 + "px;" + imgStyle + ";"
                 + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                 + "(src=\'" + myImage.src + "\', sizingMethod='scale'); \"></span>";
   myImage.outerHTML = strNewHTML;
  }
}

function showFAQAnswer(id) {
  if (document.getElementById('a'+id).style.display != "block") {
    document.getElementById('a'+id).style.display = "block";
    document.getElementById('a'+id).style.visibility = "visible";
    document.getElementById('q'+id).style.backgroundImage = "url(upload/images/Layout/faq_open.gif)";
    sIFR.replace(lieken, {
      selector: 'h1.content',
      wmode: 'transparent',
      css: '.sIFR-root { color: #4d3029; }'
    });
  }
  else {
    document.getElementById('a'+id).style.display = "none";
    document.getElementById('a'+id).style.visibility = "hidden";
    document.getElementById('q'+id).style.backgroundImage = "url(upload/images/Layout/faq_closed.gif)";
  }
}

function openPopup(url,width,height) {
	settings="width="+width+",height="+height+",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no,dependent=no";
	win=window.open(url,"broschuere",settings);
	win.focus();
}

function showKontaktFormFields() {
  if (document.getElementById("betreff").value == "3") {
    document.getElementById("reklamation").style.display = "block";
  }
  else {
    document.getElementById("reklamation").style.display = "none";
  }
}

var player;

function startMehlFilm() {
  document.getElementById('video').style.display = 'none';
  document.getElementById('mehlmovie').style.display = 'block';
}

function showEndSharing() {
  document.getElementById('tischbg').style.display = 'none';
  document.getElementById('videoplayer').style.display = 'none';
  document.getElementById('mehlbutton').style.display = 'none';
  document.getElementById('mehlclose').style.display = 'none';
  document.getElementById('mehlplay').style.display = 'block';
  document.getElementById('sharing').style.display = 'block';
}

function mehlPlayAgain() {
  document.getElementById('tischbg').style.display = 'block';
  document.getElementById('videoplayer').innerHTML = '';
  document.getElementById('videoplayer').style.display = 'block';
  document.getElementById('mehlbutton').style.display = 'block';
  document.getElementById('mehlclose').style.display = 'block';
  document.getElementById('mehlplay').style.display = 'none';
  document.getElementById('sharing').style.display = 'none';
  var so1 = new SWFObject("/mehlstart/player_page.swf", "playerswf", "571", "329", "9");
  so1.addParam("scale", "showall");
  so1.addParam("quality", "high");
  so1.addParam("bgcolor", "#ffffff");
  so1.addParam("wmode", "transparent");
  so1.addParam("menu", "false");
  so1.addParam("allowScriptAccess", "always");
  so1.write("videoplayer");
}

function showSharing() {
	player = document.getElementById('playerswf');
  document.getElementById('sharing').style.display = 'block';
}

function unshowSharing() {
  document.getElementById('sharing').style.display = 'none';
}

function showRezept(id) {
  unshowRezept();
  document.getElementById('buttonimage'+id).src = 'upload/images/Layout/button_'+id+'_on.png';
  document.getElementById('rezept'+id).style.display = 'block';
  sIFR.replace(lieken, {
    selector: 'h3.mrezept, h4.mrezept',
    wmode: 'transparent',
    css: '.sIFR-root { color: #4d3029; font-size:36px; }'
  });
}

function unshowRezept() {
  for(var i=1;i<=3;i++) {
    document.getElementById('buttonimage'+i).src = 'upload/images/Layout/button_'+i+'.png';
    document.getElementById('rezept'+i).style.display = 'none';
  }
}