var _arrayLength = 0;
var objBanner = new objBannerContainer();
var objSubBanner = new objBannerContainer();
objBanner.Text = CreateTextObject();
objSubBanner.Text = CreateSubTextObject();

function objText()
{
	this.TopQuote = "";
	this.BottomQuote = "";
}

function objBannerContainer()
{
	this.Text = [];
}

function CreateTextObject()
{
	
	var Text = [];
	
	Text[0] = new objText();
	Text[0].TopQuote = "We believe in treating and healing the <span>whole body</span>,"
	Text[0].BottomQuote = "not just the <span>symptoms</span>."
	
	Text[1] = new objText();
	Text[1].TopQuote = "The power that <span>created</span> the body,"
	Text[1].BottomQuote = "is the same power that <span>heals</span> the body."
	
	return Text;
	
}

function CreateSubTextObject()
{
	
	var Text = [];
	
	Text[0] = new objText();
	Text[0].TopQuote = "Pain let's you know that <span>you have a problem</span> with your body,"
	Text[0].BottomQuote = "If you <span>ignore the pain or mask the pain</span>, you may set yourself up for <span>larger problems</span> in the future."
	
	Text[1] = new objText();
	Text[1].TopQuote = "We believe in the importance of treating and healing the <span>whole body</span>,"
	Text[1].BottomQuote = "not just creating a temporay solution that will mask the <span>symptoms</span>."
	
	return Text;
	
}


function InitDisplayText(i) {
	
		$(".text_top" + i)
			.show(0)
			.animate({ fontSize: "12px" }, 1000 ); 
		
		var timeout2 = setTimeout(function() { 
			$(".text_bottom" + i).fadeIn(500);
		}, 2800);
	
		var timeout1 = setTimeout(function() {
			$(".slider").hide(0);
			$(".fade").hide(0);
			i++; 
			if(i >= _arrayLength) 
			{ 
				i = 0
				$(".slider").filter(":not(:animated)").animate({             
				  borderLeftWidth: 0,
				  fontSize: 0         
			  }); 
			}
			InitDisplayText(i);
				
			}, 8000);
	
	}

function DisplayText(obj)
{
	$.each(obj.Text, function (index, quote) {
		
		_arrayLength = obj.Text.length;
		
		$(".text_container").append('<p class="slider text_top' + index + '"><span>&ldquo;</span>' + quote.TopQuote + '</p><p class="fade text_bottom' + index + '">' + quote.BottomQuote + '<span>&rdquo;</span></p>');
		
	});
	
	var i = 0;
	InitDisplayText(i);
	
}
										

