var thinkdigital = {
	init: function() {
		// run functions
		this.show_biographies();
        this.fix_target();
        this.validate();
	},
        
    show_biographies: function() {
        //$(".agenda").addClass('js_on');
        target = '#biography_popup';
		
		// Ensure element is in the DOM
		if(!$(target)) {
			return;
		}
    
		$('#agenda a[href*=#]').click(function(){
            
            var biography = $(this).attr('href'); 
            
            //hide all open
            $(".biography").hide();
            $("#biography_popup").show();
            //show relevant biog
            $(biography).show();
			return false;
                     
	    });
        
        $('a.close_button').click(function(){
            $("#biography_popup").hide();
            return false;
	    });                
	},
    
    fix_target: function() {
		$('a[href*=http://]').click(function(){
	        window.open(this.href);
	        return false;
	    });
	},
    
    validate: function() {
    
        target = '#registration_form';
		
		// Ensure element is in the DOM
		if(!$(target)) {
			return;
		}
    
		$('#submit').click(function(){
	        var areAllValid = LiveValidation.massValidate( [ field1, field2, field3, field4, field5, field6 ]  )
                if  (!areAllValid) {
                    $('#error_message').show();
                    return false;
                }   
	    });
	}
    
    
    
}
$(document).ready(function() {
	thinkdigital.init();    
});


