$(document).ready(function() {
    $("#team").change(function() {
        if(this.value == '') {
            $("#profile").css("display", "none");
        } else {
            $("#profile").css("display", "block");
        }
    });
    
    
    $("#reporter_fname").focus(function() {    
        clr(this, $(this).attr("title"), '');
    }).blur(function() {
        clr(this, $(this).attr("title"), '');
    });
    
	$("#reporter_lname").focus(function() {    
        clr(this, $(this).attr("title"), '');
    }).blur(function() {
        clr(this, $(this).attr("title"), '');
    });
	
	$("#reporter_email").focus(function() {    
        clr(this, $(this).attr("title"), '');
    }).blur(function() {
        clr(this, $(this).attr("title"), '');
    });
	
	$("#reporter_phone").focus(function() {    
        clr(this, $(this).attr("title"), '');
    }).blur(function() {
        clr(this, $(this).attr("title"), '');
    });        
    
    function clr(obj, txt, def ) {
        if(obj.value == txt) {
            obj.value = def;            
        } else if(obj.value == def) {
            obj.value = txt;            
        }
    }
    
        
    $('.infobox a').click(function(){
      $('.infobox').hide('slow');  
    })
    
    $('.close-popup').click(function(){
      $('.popup').fadeOut('slow');  
    })
    
    $('.explanation').css('display','none');
    $('a.thinking_text').click(function(){
       $('.explanation').fadeIn('slow');
    });
    
});

