// JavaScript Document
 

var getConcrete5={
	
	init:function(){ 
		this.headerRollovers();
		this.quoteBubbleAnimation();
	},
	headerRollovers:function(){ 
		$('#headerLinkSection ul li').each(function(num,el){ 
			el.onmouseover=function(){ $(this).addClass('over'); }
			el.onmouseout=function(){  $(this).removeClass('over'); }
		}); 
	},
	quotePositions:[ {'left':70,'top':-200} ,{'left':250,'top':-205} ,{'left':178,'top':-205} ,{'left':40,'top':-210},{'left':120,'top':-205} ],
	quoteStr:'', 
	quoteBubbleAnimation:function(){
		this.quoteBubble=$('#quoteBubble');
		if(typeof document.body.style.maxHeight == "undefined"){
			this.quoteBubble.addClass('noDisplay');
			return false;
		}
		
		this.quotes=this.quoteStr.split('|'); 
		if(this.quotes.length==0) return false;
		this.quoteCounter=-1;
		this.quotePosCounter=-1;
		this.replaceQuote();
	},
	getNextQuote:function(){
		this.quoteCounter++;
		if(this.quoteCounter>=this.quotes.length) this.quoteCounter=0;	
		return this.quotes[this.quoteCounter];
	},
	getQuoteCoords:function(){
		this.quotePosCounter++;
		if(this.quotePosCounter>=this.quotePositions.length)this.quotePosCounter=0;
		return this.quotePositions[this.quotePosCounter];
	},
	replaceQuote:function(){
		this.quoteBubble.animate( { opacity:0 }, 500, 'easeInCirc', function(){		   
			$('#quoteTxt').html( getConcrete5.getNextQuote() ); 
			var coords=getConcrete5.getQuoteCoords(); 
			this.style.left=coords.left+'px';
			this.style.top=coords.top+'px'; 
			setTimeout( 'getConcrete5.showQuote();',5100 );//the time between quotes
		});
	},
	showQuote:function(){
		this.quoteBubble.animate( { opacity:1 }, 500, 'easeOutCirc', function(){
			setTimeout( 'getConcrete5.replaceQuote();',3000 );//how long the bubble's shown
		});
	}
} 
$(function(){getConcrete5.init()}); 


//T.Trupp/InnerOptics - clear initial text of a field when it's clicked
function clrInitTxt(field,initText,removeClass,blurred){
	if(blurred && field.value==''){
		field.value=initText;
		$(field).addClass(removeClass);
		return;	
	}
	if(field.value==initText) field.value='';
	if($(field).hasClass(removeClass)) $(field).removeClass(removeClass);
}
