(function($) {
	$.fn.homepageLoad = function(options) {
	
		var defaults = {}
		var options = $.extend(defaults, options);
						 
		return this.each(function() {

			var obj = $(this);			
			var isActive = false;
			
			var circleAimg = [141,141,158,158];
			var circleBimg = [140,140,160,160];
			var circleCimg = [190,190,210,210];
			var circleDimg = [156,156,176,176];

									

			obj.children().each(function() {

				$(this).bind('click', function(event) {
					event.preventDefault();
				/*	
					if(isActive == false) {
						isActive = true;					
					
						var circleId = $(this).attr('id');
						$(this).contents().attr('src', 'images/circles/'+$(this).attr('id').toLowerCase()+'.png');					
						$(this).find('img').addClass("active");

						var title = getCircleTitle(circleId);

						$('#intro').find('div').fadeOut('slow', function() {	});

						$('#titleHeader').fadeOut('slow', function() {															
							$('#titleHeader').css('background', 'none');
								$('#titleHeader').html(title);
								Cufon.refresh();

								$('#titleHeader').fadeIn('slow', function() {
									
								});
						});


						$('.infoactive').fadeOut('slow', function() {
							$(this).removeClass('infoactive');	
							
							$('#'+circleId+'-info').fadeIn('slow', function() {
								$(this).addClass('infoactive');
								isActive = false;
							});
						});

						$(this).parent().children().each(function() {

							if(circleId != $(this).attr('id')) {
								$(this).contents().attr('src', 'images/circles/'+$(this).attr('id').toLowerCase()+'-grey.png');

								var circle = getCircleDimensions($(this).attr('id'));
								$(this).find('img').removeClass('active')											
								$(this).css({'z-index' : '0'}); 
								$(this).find('img').removeClass("hover").stop()  
									.animate({
										marginTop: '0', 
										marginLeft: '0',
										top: '0',
										left: '0',
										width: circle[0]+'px', 
										height: circle[1]+'px',
										padding: '5px'
									}, {duration: 400});
							}
						});										
					}
					
				*/					
				});

				$(this).hover(function() {
						var isActive = $(this).find('img').hasClass('active');

						if(!isActive) {
							var circle = getCircleDimensions($(this).attr('id'));					
							$(this).css({'z-index' : '10'}); /*Add a higher z-index value so this image stays on top*/ 
							$(this).find('img').addClass("hover").stop() /* Add class of "hover", then stop animation queue buildup*/
								.animate({
									marginTop: '-10px', /* The next 4 lines will vertically align this image */ 
									marginLeft: '-10px',
									top: '50%',
									left: '50%',
									width: circle[2]+'px', /* Set new width */
									height: circle[3]+'px', /* Set new height */
									padding: '0px'
								}, {duration: 400}); /* this value of "200" is the speed of how fast/slow this hover animates */
						}
						} , function() {
							
						var isActive = $(this).find('img').hasClass('active');	
						
						if(!isActive) {							
							var circle = getCircleDimensions($(this).attr('id'));											
							$(this).css({'z-index' : '0'}); /* Set z-index back to 0 */
							$(this).find('img').removeClass("hover").stop()  /* Remove the "hover" class , then stop animation queue buildup*/
								.animate({
									marginTop: '0', /* Set alignment back to default */
									marginLeft: '0',
									top: '0',
									left: '0',
									width: circle[0]+'px', /* Set new width */
									height: circle[1]+'px', /* Set new height */
									padding: '5px'
								}, {duration: 400});
						}
				});

				function getCircleTitle(id) {
					switch(id) {
						case "circleA" : return "End to end analytics"; break;
						case "circleB" : return "Insight and innovation"; break;
						case "circleC" : return "Entrepreneurial spirit with global scale"; break;
						case "circleD" : return "Multi-channel Expertise"; break;
					}
				}
				function getCircleDimensions(id) {
					switch(id) {
						case "circleA" : return circleAimg; break;
						case "circleB" : return circleBimg; break;
						case "circleC" : return circleCimg; break;
						case "circleD" : return circleDimg; break;																		
					}	
				}	


			});
	
		});
	}
})(jQuery);