$(document).ready(
		function()
		{
			$('#fisheye').Fisheye(
				{
					maxWidth: 50,
					items: 'a',
					itemsText: 'span',
					container: '.fisheyeContainer',
					itemWidth: 40,
					proximity: 40,
					alignment : 'left',
					valign: 'bottom',
					halign : 'center'
				}
			)

	$(".accordion").Accordion(
			{
				headerSelector: 'dt',
				panelSelector: 'dd',
				activeClass: 'myAccordionActive',
				hoverClass: 'myAccordionHover',
				panelHeight: 90,
				speed: 300
			});
	 $('#myForm').ajaxForm(function() { 
	         $("#application").fadeOut("fast");
	         $("#application").queue(function(){
	            $(".person_info").html("<em>Thank you for your interest in pursuing employment opportunities with Guidance.  One of our recruiters will review your resume, and will contact you within 24 to 72 hours if there is an appropriate opportunity that matches your background.  If your resume does not meet the specific requirements and background of our current openings, we will file your resume for consideration for future opportunities.  In the meantime, please visit <a href='http://www.guidance.com'>www.guidance.com</a> for additional information.</em>");
	          });
        }); 

		});


function recursiveHidePrev(target){
    if ($(target).prev().hasClass("row")){
	$(target).prev().slideUp("slow",recursiveHidePrev($(this).prev()));
    }
}

function showInfo(targetId, caller){
    myParent = $(caller).parent();

    if($(".row:hidden").size() > 0){
	/*$(".links_area .person_links:visible").fadeOut("slow");*/
	/*$("#links_"+targetId).fadeIn("slow"); */

	$(".person_info:visible").fadeOut(2000);
	$(".person_info:visible").queue(function(){
	    $("#info_"+targetId).fadeIn(2000);
	    $(this).dequeue();
	}); 
    } else {
	/* turns out we aren't messing with the links
	$("#default_links").fadeOut("slow");
	$("#links_"+targetId).fadeIn("slow");
        */

	$(myParent).nextAll().slideUp("slow");
	$(myParent).prevAll().slideUp("slow");
	/*we have to use queue instead of putting it on prevAll so that it is only run once */ 
	if($(myParent).nextAll().size() > 0){
	    $(myParent).next().queue(function(){
		$("#info_"+targetId).fadeIn("slow");
		$(this).dequeue();
	    }); 
	} else if($(myParent).prevAll().size() > 0){
	    $(myParent).prev().queue(function(){
		$("#info_"+targetId).fadeIn("slow");
		$(this).dequeue();
	    }); 
	} else {
	    /*apparently we only have one row. Sort of takes the fun out of it */
	    $("#info_"+targetId).fadeIn("slow");
	    $(this).dequeue();
	}
    }
}

function showMain(){
/*    $(".person_links:visible").fadeOut("slow"); */

    $(".person_info:visible").fadeOut("slow");
    $(".person_info:visible").queue(function(){
	$(".row:hidden").dequeue();
	$(".row:hidden").slideDown("slow");
    });
    $(".person_info:visible").dequeue();
    
  
}

function filterContacts(filter_by){
	$(".col").removeClass("glow");
	$(filter_by).addClass("glow").fadeIn("slow");
	if (!$(filter_by)){
		$(".col").fadeOut("slow");
	}
   
}