function _recipe ( recipe ) {
	var nWide, nHigh, xPosition, yPosition, url, recipeWindow, args;
	
	nWide = 780;
	xPosition = ( screen.width - nWide ) / 2 - 10;
	if ( screen.width <= ( nWide + 20 ) ) {
		nWide = screen.width - 40;
		xPosition = 0;
	}
	nHigh = screen.height - 40;
	yPosition = 0;

	args = "width=" + nWide + "," 
	+ "height=" + nHigh + "," 
	+ "location=no," 
	+ "menubar=no,"
	+ "resizable=yes,"
	+ "scrollbars=yes,"
	+ "status=yes," 
	+ "titlebar=no,"
	+ "toolbar=no,"
	+ "hotkeys=no,"
	+ "screenx=" + xPosition + ","  //NN Only
	+ "screeny=" + yPosition + ","  //NN Only
	+ "left=" + xPosition + ","     //IE Only
	+ "top=" + yPosition;           //IE Only
	
	url = 'recipes/index.php?' + recipe;
	recipeWindow = window.open( url, 'recipe', args );
	recipeWindow.focus();
}

function _msie_replace_png_imgs() {
	var i, elements;

	elements = document.getElementsByTagName( "img" );
	for ( i = 0; i < elements.length; i++ ) {
		var img = elements[i];
		if ( img.src.toLowerCase().search(/\.png$/ ) < 0 ) continue;

		img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + img.src	+ "', sizingMethod='image')";
		img.src = "img/spacer.gif";
	}
}

if ( window.attachEvent && navigator.appName == "Microsoft Internet Explorer" ) window.attachEvent ( "onload", _msie_replace_png_imgs );

