showNextPizzaText = false;
showNPBlock = false;

$(document).ready(function(){
	ShowSmallPizzaText();
	window.setInterval (ShowSmallPizzaText, 300);
});

function SetShowOpt() {
	showNPBlock = true;
}

function ShowSmallPizza() {
	var oPizza = document.getElementById('next_pizza_content');
	var oText = document.getElementById('next_pizza_name');
	
	if( !showNextPizzaText ) {
		$(oPizza).animate(
			{
				left: 0
			},
			400,
			function() {
				showNextPizzaText = true;
				ShowSmallPizzaText();
			}
		);
	}
}

function ShowSmallPizzaText() {
	var oText = document.getElementById('next_pizza_name');
	var oContainer = document.getElementById('next_pizza_reducer');
	var iWidth = parseInt(oContainer.offsetWidth);
	if( showNextPizzaText ) {
		cmnSet_class( oText, ' ', 'hidden' );
		
		( iWidth >= 200 ) ? cmnSet_class( oText, 'next_pizza_name_left_indent', ' ' ) : cmnSet_class( oText, ' ', 'next_pizza_name_left_indent' );
	}
}

function HideSmallPizza() {
	if(showNPBlock) {
		showNPBlock = false;
		return;
	}
	setTimeout( _HideSmallPizza, 1500 );
}

function _HideSmallPizza() {
	if(showNPBlock)
		return;
	var oPizza = document.getElementById('next_pizza_content');
	var oText = document.getElementById('next_pizza_name');
	
	if( showNextPizzaText ) {
		HideSmallPizzaText();
		showNextPizzaText = false;
		$(oPizza).animate(
			{
				left: '75%'
			},
			400
		);
	}
}

function HideSmallPizzaText() {
	var oText = document.getElementById('next_pizza_name');
	cmnSet_class( oText, 'hidden', ' ' );
}
