$(function(){
	
		$('#searchFieldLabel').hide();
		var labelText = $('#searchFieldLabel').text();
		
	//	if($('#searchField').val() == "")
	//	{
		  	$searchExpandAmount = '200';
		  	$expandSpeed = '250';
		  	
		  $('#searchField').val(labelText)
		  .focus(function() {
		  
		  	$(this).animate({width:'+='+$searchExpandAmount}, $expandSpeed, 'swing');
		  	$(this).parent().animate({width:'+='+$searchExpandAmount}, $expandSpeed, 'swing');
		  	$(this).parent().parent().animate({width:'+='+$searchExpandAmount}, $expandSpeed, 'swing');
		  	
		    if (this.value == $(this).prev().text()) {
		      $(this).val('');
		    };
		  }).blur(function() {
		  
		  	$(this).animate({width:'-='+$searchExpandAmount}, $expandSpeed, 'swing');
		  	$(this).parent().animate({width:'-='+$searchExpandAmount}, $expandSpeed, 'swing');
		  	$(this).parent().parent().animate({width:'-='+$searchExpandAmount}, $expandSpeed, 'swing');
		  	
		    if (this.value == '') {
		      $(this).val($(this).prev().text());
		    };
		  });
	//	};
	
	$('.navItem').click(function(){
		$('.selected').removeClass('selected');
		$(this).addClass('selected');
	});
	
	
	$('#shrinkFont').click(function(){
		$('body').css('font-size', (parseInt( $('body').css('font-size') )-1)+"px" );
	});
	
	
	$('#growFont').click(function(){
		$('body').css('font-size', (parseInt( $('body').css('font-size') )+1)+"px" );
	});
	
	
	$('#coda-slider-1').codaSlider(
	{
		dynamicArrows:false,
		dynamicTabsAlign:"left"
	}
	);
	
	
			
	$('#contactTags').scrollFollow({
		speed:200,
		offset:300
	});
	
	$("#locationTag, #twitterTag, #facebookTag").mouseover(function(){
		$(this).animate({ marginLeft:'10px' }, 200, 'swing');
	}).mouseout(function(){ 
		$(this).animate({ marginLeft:'0px' }, 200, 'swing');
	}).qtip({
			show:{
				delay:0
			},
			position:{
				corner:{
					target:'leftMiddle',
					tooltip: 'rightMiddle'
				},
				adjust:{
					x:13,
					y:-5
				}
			},
			style: { 
				background:'#eaeaea',
				color:'#444444',
				textAlign:'left',
				border:{
					width:3,
					radius:6,
					color:'#eaeaea'
				},
				tip:'rightMiddle'
			}
		});
		
	$contactTooltip = $('#locationTag').qtip('api');
		
	$('#locationTag').click(function(){
		$contactTooltip.hide();
		
			$.fancybox(
			$('#contactContent'),
			{
				'titlePosition'		: 'inside',
				'overlayColor': '#000',
				'overlayOpacity':'0.6'
			});
	});
	
	$('a.email').nospam({replaceText:true});
	
	
	
	if( $.browser.msie && $.browser.version == "6.0" ) DD_belatedPNG.fix('.bodyContainer, .bodyContainerFooter, #bodyContentHeader, #bodyContent, #bodyContentFooter, #bodyContainerFooter');

	$.ga.load('UA-15386636-1');
	
	$('.coda-nav ul li').click(function(){
		$.ga.trackEvent('Section Visit', $(this).find('a').text());
	});
	
	$('#locationTag').click(function(){
		$.ga.trackEvent('Contact Info', "Address Tag");
	});
	
	$('#twitterTagLink').click(function(){
		$.ga.trackEvent('Contact Info', "Twitter Tag");
	});
	
	$('#facebookTagLink').click(function(){
		$.ga.trackEvent('Contact Info', "Facebook Tag");
	});

});