jQuery(document).ready(function($){	
	
	//AUTOFOCUS
	jQuery('#pdaLogin').focus();

	//IF ON CONTACT US PAGE
	var current_item = $('.current_page_item a').attr('title');
	if(current_item == 'Contact Us')
	{
		$('#contact_us').css('background', 'url(http://www.intheknowinteractive.com/wp-content/themes/itk/images/contact_usbg.png) top left no-repeat transparent');
		$('#contact_us').css('color', '#000033');
		//$('#navHover').css('visibility', 'hidden');
		$('ul#links li').hover(function(){
				$('#contact_us').css('color', '#FFFFFF');
				$('#contact_us').css('background', 'url(http://www.intheknowinteractive.com/wp-content/themes/itk/images/contact_us.png) top left no-repeat transparent');
			},function(){
				$('#contact_us').css('color', '#000033');
				$('#contact_us').css('background', 'url(http://www.intheknowinteractive.com/wp-content/themes/itk/images/contact_usbg.png) top left no-repeat transparent');
			});
		$('div#navbar').mouseover(function(){
			$('#navHover').css('visibility', 'visible');
		});
	}
	
	
	//GET CURRENT PAGE
	if($('#links .current_page_item').length > 0)
	{
		var posC = $('.current_page_item').offset();
		var posCLeft = posC.left;
		var firstCLi = $('ul#links li:first').offset();
		var moveCLeft = posCLeft - firstCLi.left;
		$('#navHover').css('left', moveCLeft);
	}
	else if($('#links .current_page_ancestor').length > 0)
	{
		var posC = $('#links .current_page_ancestor').offset();
		var posCLeft = posC.left;
		var firstCLi = $('ul#links li:first').offset();
		var moveCLeft = posCLeft - firstCLi.left;
		$('#navHover').css('left', moveCLeft);
	}
	
	//SLIDER WRITTEN BY CLIFTONHATFIELD.COM
	$('ul#links li').stop().hover(function(){
		var pos = $(this).offset();
		var posLeft = pos.left;
		var firstLi = $('ul#links li:first').offset();
		var moveLeft = posLeft - firstLi.left;
		$('#navHover').stop().animate({ left: moveLeft }, 500);
	},function(event){
		if($('#links .current_page_item').length > 0)
		{
			var pos = $('#links .current_page_item').offset();
			var posLeft = pos.left;
			var firstLi = $('ul#links li:first').offset();
			var moveLeft = posLeft - firstLi.left;
			$('#navHover').stop().animate({ left: moveLeft }, 500);
		}
		else
		{
			var pos = $('ul#links li').offset();
			var posLeft = pos.left;
			var firstLi = $('ul#links li:first').offset();
			var moveLeft = posLeft - firstLi.left;
			$('#navHover').stop().animate({ left: moveLeft }, 500);
		}
	});	
	
	//FORMS
	$('.form-float input[type="text"]').focus(function(){
		var value = $(this).val();
		var variable = $(this).attr('var');
		if(value == variable)
		{
			$(this).val('').css('color', '#333');
		}
	});
	$('.form-float input[type="text"]').blur(function(){
		var value = $(this).val();
		var variable = $(this).attr('var');
		if(value.length == 0)
		{
			$(this).val(variable).css('color', '#666');
		}
	});
	
	$('.page-item-255 a').attr('href', 'http://theconnectedcaregiver.com/');
	
});
