google.load("jquery", "1.3.2");
google.load("jqueryui", "1.7.2");
google.setOnLoadCallback( function() { Site.init() });


var Site = {
	
	init: function() {			
			this.setEmail();
	},
	setEmail: function() {
		$(".footer ul li:first").text("lismanBusiness@gmail.com");	
	}
	
	
		
}


//constructor for Catchprase
function CatchphraseSpewer( opts ) {
	
	$("<img src='assets/img/word_of_mouth.png' class='mouth' />")
				.prependTo(".content");
	$(".meet").click(  function() {	  
					$(this).animate( { top:50  }, 1000 );
					return false;
				});
	
	$.extend( this.opts, this.defaults, opts );
	
	//this.spew();		
}

CatchphraseSpewer.prototype = {	
	defaults : {},
	opts : {},
	words: [],
	spew : function() {
 		var self = this;
		$words = $("dt");
		
		//
		$("dt").each(    function() {
				var word = "<div class='spewWord'>{word}</div>".supplant( { word: $(this).text() } );
				self.words.push($(word).prependTo("body"));
		});

		wordIndex = 0;
		self.interval = setInterval( function() {
			if (wordIndex < 10) {
				self.animateWord(self.words[wordIndex]);			
				wordIndex++;
			} else {
				clearInterval(self.interval);	
			}
		}, 1000 );
		
				
	},
	animateWord: function(word) {					
					   word.animate( { fontSize: 800, left:-100, top:200 },4000 );	
	}
	
}


// UTILITY EXTENSIONS
// from Douglas crockford's remedial javascript
String.prototype.supplant = function (o) {
    return this.replace(/{([^{}]*)}/g,
        function (a, b) {
            var r = o[b];
            return typeof r === 'string' || typeof r === 'number' ? r : a;
        }
    );
};
