//SOCIAL INK JQUERY FOR PARKING MOBILITY
//copyright (c) 2010-11
//info@social-ink.net
	
	var $ap = jQuery.noConflict(); //avoid potential WP problems
	
	$ap(function(){
	
	
		//fp mods for connect module
		
		//alert($ap('.connect_widget_number_cloud').val()); 
		
		/*function enlargeFbBox() {
			fbFrameHeight = $ap('#featured iframe.fb_ltr').height();
			fdFrameNewHeight = 7+fbFrameHeight;
			$ap('#featured iframe.fb_ltr').height(fdFrameNewHeight);
		}
		
		$ap(document).ready(function(){
			changeFb=setTimeout("enlargeFbBox()",1500);
		}); */

		
		//sidebar mods
		
		$ap('ul.children').hide();
		
		$ap('.current_page_parent').children('.children').show(); 
		$ap('.current_page_item').children('.children').show(); 
		

		
		//slideshow

		$ap('#applaunch_slideshow').cycle({
			fx:       	'scrollLeft',
			timeout:   	2000,
			next:   	'#applaunch_slideshow', 
			pause:   	1 
		});		
		
		$ap('#fp_charity_slideshow').cycle({
			fx:       	'scrollLeft',
			timeout:   	4000,
			//next:   	'#fp_charity_slideshow', 
			pause:   	1 
		});
		
		//my account jquery
		
		//imput clearing
			var clearMePrevious = '';
			
			// clear input on focus
			$ap('.clearMeFocus').focus(function()
			{
				if($ap(this).val()==$ap(this).attr('title'))
				{
					clearMePrevious = $ap(this).val();
					$ap(this).val('');
				}
			});
			
			// if field is empty afterward, add text again
			$ap('.clearMeFocus').blur(function()
			{
				if($ap(this).val()=='')
				{
					$ap(this).val(clearMePrevious);
				}
			});

		
		$ap("#edit_settings").click(function() {
				$ap("#myaccount_settings").slideToggle("fast");	
				return false;
			});
			
			
		$ap.ajax({
		  url: '/user/_useracctinfo.php',
		  dataType: 'json',
		  type: 'GET',
		  success: function(data) { 
				$ap("#header_loggedinuser").text("Welcome! Logged in as: " + data.email);
				$ap("#headerlink_myaccount").attr("href", $ap("#headerlink_myaccount").attr("href") + data.email);

				
			},
		  error: function(data) { console.log(data); }
		});			


});

