
	Cufon.set('fontFamily','Rage')
			.replace('h4')
		
		.set('fontFamily','Clarendon')
			.replace('#nav > ul > li > a', {hover:true})
			.replace('.button', {hover:true})
			.replace('.cufon',  {hover:true})
			.replace('h1')
			.replace('h2')
			.replace('h3')
			.replace('#featured-current .meta')
			.replace('#steps li')
			.replace('.title')
            .replace('ul.display li h4');

        $('.like').live("click", function() {
			var id = $(this).attr('id').replace('like-', '');
			var string = 'id='+ id;

			$.ajax({
				type: "POST",
				url: "/profiles/like.json",
				data: string,
				cache: false,
				success: function(response) {
                                        if (response.status == "redirect") {
                                            window.location = response.to;
                                        } else {
                                            $('#like-'+ id).html('<a href="javascript: void(0)" id="unlike-' + id + '" class="unlike">Unlike</a>');
                                            $('#likes-'+ id).text(parseInt($('#likes-'+ id).text()) + 1);
                                        }
                                    }
			});

			return false;
		});

        $('.unlike').live("click", function() {
			var id = $(this).attr('id').replace('unlike-', '');
			var string = 'id='+ id;

			$.ajax({
				type: "POST",
				url: "/profiles/unlike.json",
				data: string,
				cache: false,
				success: function(response) {
                                        if (response.status == "redirect") {
                                            window.location = response.to;
                                        } else {
                                            $('#unlike-'+ id).html('<a href="javascript: void(0)" id="like-' + id + '" class="like">Like</a>');
                                            $('#likes-'+ id).text(parseInt($('#likes-'+ id).text()) - 1);
                                        }
                                 }
			});

			return false;
		});

	// Manage account dropdown
	var dropdown_timer;
	
	$(document).ready(function(){
		$('li.nav_dropdown ul').slideUp(0).mouseover(function(){
			clearTimeout(dropdown_timer);
		});
		
		$('li.nav_dropdown').hover(function(){
		
			if(!$('ul',this).is(':animated')){
				$('ul',this)
					.dequeue()
					.stop()
					.slideDown(200);
			}
			
			clearTimeout(dropdown_timer);
			
			$('#nav_dropdown .title').addClass('nav_hover');
			Cufon.refresh('.title');
			
		},function(){
		
			var parent = this;
			
			dropdown_timer = setTimeout(function(){
			
				$('ul',parent).slideUp(200,function(){
					$('ul',parent).stop().dequeue();
					$('#nav_dropdown .title').removeClass('nav_hover');
				});
				
				$('#nav_dropdown .title').removeClass('nav_hover');
				
				Cufon.refresh('.title');
			},200);
			
			
		});
	});
	
	
	// replace (optional) with spanned version
	
	$(document).ready(function(){
		$('label').each(function(){
		
			if(String($(this).text()).indexOf('(optional)')>0){
			
				var newText = $(this).text().replace('(optional)','<span class="optional">(optional)</span>');
				
				$(this).html(newText);
				
			}
			
		});
	});

        	$(document).ready(function(){
		$('label').each(function(){

			if(String($(this).text()).indexOf('(< 6 months)')>0){

				var newText = $(this).text().replace('(< 6 months)','<span class="optional">(< 6 months)</span>');

				$(this).html(newText);

			}

		});
	});

	// for firefox/ie friendly debug
	
	function trace(x){if(console)console.log(x);}
	
	
	
