function _upFront ( thumb ) {
	var oldIndex = document.getElementById( "thumb_" + thumb ).style.zIndex;

	for ( i = 0; i < thumbCount; i++ ) {
		thisIndex = document.getElementById( "thumb_" + i ).style.zIndex;
		if ( thisIndex > oldIndex ) document.getElementById( "thumb_" + i ).style.zIndex = thisIndex - 1;
	}

	document.getElementById( "thumb_" + thumb ).style.zIndex = thumbCount;
}

var d, oldText, oldFontSize, oldFontColor;

function _showIt ( text ) {
	d = document.getElementById( 'home' );
	oldText = d.innerHTML;
	oldFontSize = d.style.fontSize;
	oldFontColor = d.style.color;
	d.innerHTML = "<p>" + decodeURI( text ) + "</p>";
	d.style.fontSize = "14px";
	d.style.color = "#000";
}

function _hideIt () {
	d.innerHTML = oldText;
	d.style.fontSize = oldFontSize;
	d.style.color = oldFontColor;
}

function _showRecipe ( recipe ) {
	nWide = 750;
	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();
}

var thumbNumber = 0;

function _showThumbs () {
	document.getElementById( "thumb_" + thumbNumber ).style.visibility = "visible";
	thumbNumber++;
	if ( thumbNumber < thumbCount ) {
		setTimeout ( "_showThumbs()", 200 );
	} else {
		document.getElementById( "home" ).style.visibility = "visible";
	}
}

