$(document).ready(function() {
//BEGIN

    // Inserts arrow next to side navigation when active
    $('<img src="/wp-content/themes/pacdc/img/snavarrow.gif" class="snavarrow">').insertAfter('ul.snav li.current_page_item a:first'); 
     $('<img src="/wp-content/themes/pacdc/img/snavarrow.gif" class="snavarrow">').insertAfter('ul.snav li.current-cat a:first'); 
    
	//TABLE effects
	$('.stripeme tr:even').addClass('alt');
	
	//Census Tooltip
	$('map *').tooltip({
		    track: true, 
   			delay: 0, 
			showURL: false, 
			showBody: " - ", 
			fade: 250 
		});
		
	/*
		Create Variable containing current value of textbox
		Check if textbox is empty
		If empty set value of textbox to name value of clicked area
		If not empty, save current value and then add the name value of clicked area to textbox
	*/
		
		$('area').click(function() { 
			var txt = $("#tract").val();
			if (txt == '') {
				txt = $(this).attr('name');
			} else {
				txt = $("#tract").val()+', '+ $(this).attr('name');
			}
	
			//Sets the value of textbox to current value of txt
			$("#tract").val(txt);
			//$("ul.selectedtracts").append('<li>'+$(this).attr('name')+'</li>');
				return false; 
		});
		
		
		
		$('table.censustable tr').each(function() {
    		$(this).find("td").eq(4).addClass('phila');
    		$(this).find("td").eq(5).addClass('phila');      
		});
		

//Login form on homepage - handles default values of text fields.

$('.multiple_callback').example(function() {
 return $(this).attr('title'); 
});


//END
});