	//yonis jquery stuff for socialink
	//yoni@social-ink.net


	var $j = jQuery.noConflict(); //declare this cause of problems with WP

	$j(function(){

	//frontpage tab
	
		$j(".fp_tabslide_content").hide();
							
		$j(".fp_tabslide_header").click(function() {
				
			$j(this).toggleClass("auto_expanded");
			
			if($j(this).is('.auto_expanded')) {
				$j('.fp_tabslide_content').show();

				$j('#fp_tabslide').animate({ 
					top: '-=200',
				  }, 300, function() {
					// Animation complete.
				  });
			}  else {
				
				
				$j('#fp_tabslide').animate({
					top: '+=200',
				  }, 200, function() {
					// Animation complete.
					$j('.fp_tabslide_content').hide();
				  });
				  
				  

			  }


				
			});	
			
		//post type hack for wp_nav_menu's limitations

		if($j('.onepage').hasClass('posttype_stories')) {
			$j("#menu-item-58").addClass('current-post-ancestor');
		}
		
		
		
		//slideshows
		$j('#fp_slideshow_back').cycle({
			fx:       	'fade',
			timeout:   	4000,
			speed: 450,
			//next:   	'#slidearea_fptop',
			pause:   	1		
		});				


	// FUNCTIONS FOR EXPANDING AND SO ON
		$j(".hidden_box").hide();
							
		$j(".header_expand_moretext").click(function() {
				$j(this).parents().children(".hidden_box").slideToggle('medium');
				$j(this).toggleClass("auto_expanded");
			});	
			
		$j(".text_expand").click(function() {
					$j(this).parents().children(".hidden_box").slideToggle('medium');
					$j(this).toggleClass("auto_expanded");
				});
					
			
			
	
	//imput clearing
	
		var clearMePrevious = '';
		
		// clear input on focus
		$j('.clearMeFocus').focus(function()
		{
			if($j(this).val()==$j(this).attr('title'))
			{
				clearMePrevious = $j(this).val();
				$j(this).val('');
			}
		});
		
		// if field is empty afterward, add text again
		$j('.clearMeFocus').blur(function()
		{
			if($j(this).val()=='')
			{
				$j(this).val(clearMePrevious);
			}
		});

	});
