<!--
function setElement(eID,ifStyle,funct,wert){
	if (document.getElementById){
		if (ifStyle == 1){
			var newElement = document.getElementById(eID).style;
		}
		else {
			var newElement = document.getElementById(eID);
		}
		newElement[funct] = wert;
	}
}

fname_old = "";
function getFallback(fname) {
	if (fname_old != "" && fname != fname_old){
		setElement(fname_old,1,"display","none");
	}
	
	setElement(fname,1,"display","block");
	fname_old = fname;
}

function flipbox(divID, image, layerHeight, layerWidth){
	var flipbox=document.getElementById(divID);
	var flipboxbg = document.getElementById('picture_zoomed_background');
	var divBackground = 'url('+image+')';
	var divHeight = ''+(layerHeight)+'px';
	var divWidth = ''+(layerWidth)+'px';
	if (flipbox!=null) {
		flipbox.style.display = (flipbox.style.display=='none') ? "block" :"none";
		flipbox.style.backgroundImage = divBackground;
		flipbox.style.height = divHeight;
		flipbox.style.width = divWidth;
	}
	if (flipboxbg!=null){
		flipboxbg.style.display = (flipboxbg.style.display=='none') ? "block" :"none";
		flipboxbg.style.height = divHeight;
		flipboxbg.style.width = divWidth;
	}
}

function flipboxsimple(divID){
	var flipbox=document.getElementById(divID);
	if (flipbox!=null) {
		flipbox.style.display = (flipbox.style.display=='none') ? "block" :"none";
	}
}

function getQueryVariable(variable) {
	  var query = window.location.search.substring(1);
	  var vars = query.split("&");
	  for (var i=0;i<vars.length;i++) {
	    var pair = vars[i].split("=");
	    if (pair[0] == variable) {
	      return pair[1];
	    }
	} 
  }

function nx_send(){
        nx_win = window.open("/nx_mail_news.php?url="+escape(document.location)+"&title="+escape(document.title),"_danke", 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=360,height=500');
        nx_win.focus();
        return false;
}




 function openEinkaufsliste(Titel,Portionen){
	
	inhalt = document.getElementById('rezept_zutaten').innerHTML;

	NewWindow=window.open('',"Einkaufsliste","height=400,width=350,scrollbars=no,toolbar=no,resizable=yes,top=100,left=100");
	
	NewWindow.document.write ("<html><head><title>");
	NewWindow.document.write (Titel);
	NewWindow.document.write ("</title>");
	NewWindow.document.write ("<link rel='stylesheet' href='style/penny_rd08.css' type='text/css'></head>");
	NewWindow.document.write ("<body class='rezepte_popup' onload='javascript:print();'>");
	NewWindow.document.write ("<table border=0 cellspacing=5 align=center width=350><tr>");
	NewWindow.document.write ("<td>");
	NewWindow.document.write ("<h2>"+Titel+"</h2><br /><span style='font-size:12px; font-style:normal;color:#000000'>Zutaten für "+Portionen+" Portionen</span><br />");
	NewWindow.document.write ("<br />"+inhalt+"</td></tr></table></body></html>");
	NewWindow.focus();
	NewWindow.document.close();
	
	
	
  }
  
  function nx_linkangebote(strurl) {
	var today = new Date();
	//mktid=getmktcookie();
	
	mycookie = getmktcookie();
						mktid_ch_array = mycookie.split("-");
						
						mktid = mktid_ch_array[0]
						chash1 = mktid_ch_array[1];
						chash2 = mktid_ch_array[2];
						chash3 = mktid_ch_array[3];
						chash4 = mktid_ch_array[4];
						viewtype = mktid_ch_array[5];
	
	var wd="";


	if (strurl.href.indexOf("id=8385")>=0) {
		if (mktid>0) {
			strurl.href="index.php?id=8385&tx_nxneuimsortiment_pi1[markt]="+mktid+"&cHash="+chash2;
		} else {
			strurl.href="index.php?id=marktauswahl0&tx_nxmarktsuche_pi1[returnid]=2-8385&cHash=8a594e6bd0";
		}
	}
	if (strurl.href.indexOf("id=8383")>=0) {
		if (mktid>0) {
			strurl.href="index.php?id=8383&tx_nxbilliger_pi1[markt]="+mktid+"&cHash="+chash3;
		} else {
			strurl.href="index.php?id=marktauswahl0&tx_nxmarktsuche_pi1[returnid]=3-8383&cHash=3de5727900";
		}
	}
	if (strurl.href.indexOf("id=8376")>=0) {
		if (mktid>0) {
			strurl.href="index.php?id=8376&tx_nxbionaturgut_pi1[markt]="+mktid+"&cHash="+chash4;
		} else {
			strurl.href="index.php?id=marktauswahl0&tx_nxmarktsuche_pi1[returnid]=4-8376&cHash=69af0a9eba";
		}
	}
	// Aktuell
	if (strurl.href.indexOf("id=8393")>=0 || strurl.href.indexOf("id=8387")>=0) {
		if (mktid>0) {
		  if (viewtype==2) {
        strurl.href="index.php?id=8716&tx_nxangebote_pi1[markt]="+mktid+"&cHash="+chash1;
			} else {
        strurl.href="index.php?id=8715&tx_nxangebote_pi1[markt]="+mktid+"&cHash="+chash1;
      }
		} else {
			strurl.href="index.php?id=marktauswahl0&tx_nxmarktsuche_pi1[returnid]=1-8393&cHash=69af0a9eba";
		}
	}
	// Vorschau
	if (strurl.href.indexOf("id=8391")>=0) {
		if (mktid>0) {
		  if (viewtype==2) {
		    strurl.href="index.php?id=8718&tx_nxangebote_pi1[markt]="+mktid+"&cHash="+chash1;
      } else {
        strurl.href="index.php?id=8720&tx_nxangebote_pi1[markt]="+mktid+"&cHash="+chash1;
      }
		} else {
			strurl.href="index.php?id=marktauswahl0&tx_nxmarktsuche_pi1[returnid]=1-8391&cHash=69af0a9eba";
		}
	}
	// Restposten
	if (strurl.href.indexOf("id=8389")>=0) {
		if (mktid>0) {
		  if (viewtype==2) {
        strurl.href="index.php?id=8719&tx_nxangebote_pi1[markt]="+mktid+"&cHash="+chash1;
			} else {
        strurl.href="index.php?id=8721&tx_nxangebote_pi1[markt]="+mktid+"&cHash="+chash1;
      }
		} else {
			strurl.href="index.php?id=marktauswahl0&tx_nxmarktsuche_pi1[returnid]=1-8389&cHash=69af0a9eba";
		}
	}
	// Vorschau2
	if (strurl.href.indexOf("id=8460")>=0) {
		if (mktid>0) {
		  if (viewtype==2) {
		    strurl.href="index.php?id=8736&tx_nxangebote_pi1[markt]="+mktid+"&cHash="+chash1;
      } else {
        strurl.href="index.php?id=8735&tx_nxangebote_pi1[markt]="+mktid+"&cHash="+chash1;
      }
		} else {
			strurl.href="index.php?id=marktauswahl0&tx_nxmarktsuche_pi1[returnid]=1-8391&cHash=69af0a9eba";
		}
	}
}
  
  function getmktcookie() {
    var lf = "\n";
    var CookieString = document.cookie;
    var CookieSet = CookieString.split (';');
    var SetSize = CookieSet.length;
    var CookiePieces
    var ReturnValue = "";
    var x = 0;
    for (x = 0; ((x < SetSize) && (ReturnValue == "")); x++) {
      CookiePieces = CookieSet[x].split ('=');
      if (CookiePieces[0].substring (0,1) == ' ') {
        CookiePieces[0] = CookiePieces[0].substring (1, CookiePieces[0].length);
      }
      if (CookiePieces[0] == 'marktid') {
        ReturnValue = CookiePieces[1];
      }
     }
     return ReturnValue;
  }
  
function printthispage(){ 
	var sOption="toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,width=835,height=600,left=100,top=25"; 

	var sWinHTML = document.getElementById('content_container').innerHTML;
	var strBereich = document.title;
	var strBody = document.body.className;
	/*if (sWinHTML.indexOf('width=797')>=0) {
		sWinHTML = sWinHTML.replace(/width=797/g, "width=624");
	}
	if (sWinHTML.indexOf('width=799')>=0) {
		sWinHTML = sWinHTML.replace(/width=799/g, "width=624");
	}*/
	
	var winprint=window.open("","",sOption); 
       winprint.document.open(); 
       winprint.document.write('<html><title>' + document.title + '</title><link rel="stylesheet" type="text/css" href="style/penny_typo3.css" /><link rel="stylesheet" href="style/pennyhu.css" type="text/css"><link rel="stylesheet" href="style/pennyhu_print.css" type="text/css"><body class="'+strBody+'" onload="window.print();">'); 
       winprint.document.write('<div style="position: relative; z-index: 10;"><img src="image/web/druck_kv_wide.png" width="818" height="145" border="0"><br>');
       winprint.document.write('<div id="infoDiv" style="position: absolute; left: 290px; top: 111px; width: 340px; height: 16px; z-index: 2; text-align: right;"><span style="font-size: 15px; color: #fff; font-family: arial; text-decoration: none;"><strong>' + strBereich + '</strong></span></div></div>');
       winprint.document.write('<div id="printable">'+sWinHTML+'</div>');
       winprint.document.write('</body></html>');
       winprint.document.close(); 
       winprint.focus(); 
}



//Rezepte
function checkRecieptCategory() {
  for (i = 0; i < document.forms['rezepte_kat'].kid.length; ++i)
    if (document.forms['rezepte_kat'].kid.options[i].selected == true)
      window.location.href = document.forms['rezepte_kat'].kid.options[i].value;
}

function checkRecieptArchive() {
  for (i = 0; i < document.forms['rezepte_archiv'].rid.length; ++i)
    if (document.forms['rezepte_archiv'].rid.options[i].selected == true)
      window.location.href = document.forms['rezepte_archiv'].rid.options[i].value;
}

//check for flash
var flashversionMin = 8;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;

if (plugin) {
	for (f = 0; f < 20; f++) {
		var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
		if (plugin.description.indexOf(f+".")>=0){
			flashversion = f;
			
			if (flashversion >= flashversionMin){
				plugin = true;
				break;
			}
		}
	}
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0)) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+flashversionMin+'")))\n');
	document.write('</SCRIPT\> \n'); 
}

function playSWF(file,id,vars,width,height,wmode,bgcolor,baseurl,wLName) {
	fsource='<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
	fsource+=' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ';
	fsource+=' ID='+id+' WIDTH="'+width+'"; HEIGHT="'+height+'">';
	fsource+=' <PARAM NAME="allowScriptAccess" VALUE="sameDomain" /> <PARAM NAME=movie VALUE="'+file+'"> <PARAM NAME=FlashVars VALUE="'+vars+'"> <PARAM NAME=menu VALUE=false>  <PARAM NAME="BASE" VALUE='+baseurl+'> <PARAM NAME=quality VALUE=high> <PARAM NAME=wmode value='+wmode+'> <PARAM NAME=bgcolor VALUE='+bgcolor+'>';
		if(navigator.userAgent.indexOf("Opera")==-1) {
			fsource+=' <EMBED src="'+file+'" FlashVars="'+vars+'" wmode='+wmode+' menu=false quality=high bgcolor='+bgcolor+'';
			fsource+=' swLiveConnect=FALSE allowScriptAccess="sameDomain" NAME='+id+' WIDTH="'+width+'" HEIGHT="'+height+'"';
			fsource+=' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" BASE='+baseurl+'>';
			fsource+=' </EMBED>';
		}
		else	{
			fsource+=' <EMBED src="'+file+'" FlashVars="'+vars+'" wmode='+wmode+' menu=false quality=high bgcolor='+bgcolor+'';
			fsource+=' swLiveConnect=FALSE allowScriptAccess="sameDomain" ID='+id+' WIDTH="'+width+'" HEIGHT="'+height+'"';
			fsource+=' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" BASE='+baseurl+'>';
			fsource+=' </EMBED>';
		}
	fsource+=' </OBJECT>';

	if (document.getElementById){
		document.getElementById(wLName).innerHTML=fsource;
	}
}

function SetLayer2(LName,funct,wert){
	if (document.getElementById){
		var newLayer = document.getElementById(LName).style;
		newLayer[funct]=wert;
	}
}

function SetLayer3(LName,funct,wert){
	if (document.getElementById){
		var newLayer = document.getElementById(LName);
		newLayer[funct]=wert;
	}
}

function CheckFile(fid,fsrc,fwidth,fheight){
	if (fsrc.indexOf(".swf")>=0){
		playSWF(fsrc,fid,"",fwidth,fheight,"opaque","#fff","",fid)
	}
	else {
		SetLayer3(fid,'innerHTML','<image src="'+fsrc+'" />');
	}
}
//-->
