window.addEvent( 'domready', function( ) {
	$$( '#frequently_asked_questions a.toggle_link' ).each( function( el ) {
    	
        // Remove the hidden class 
        var answer = el.getParent( ).getNext( );
        answer.removeClass( 'faq_answer_hiden' );
        answer.addClass( 'faq_answer_visible' );
        
        // Put the div in a toggle slide thing
        var fx = new Fx.Slide( answer );
        fx.hide( );
        
        // CLicking the link should toggle it
        el.addEvent( 'click', function( e ) {
        
            e.stop( );
            fx.toggle( );
        
        }.bindWithEvent( ) );
    
    } );
	
	var vlat = $( 'lat_coords');
	var vlong = $( 'long_coords');
	
	if ( $defined( vlat ) ) {
		var coord_lat = vlat.value;
		var coord_long = vlong.value;
		var map_label = $('map_label');		

		var myLatlng = new google.maps.LatLng(coord_lat,coord_long);
		var myOptions = {
				zoom: 15,
				center: myLatlng,
				mapTypeId: google.maps.MapTypeId.ROADMAP
		}
		
		var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);								
		
		var infowindow = new google.maps.InfoWindow({ 
			content: "<h2>" + map_label.value + "</h2>" 
		});
		
		var marker = new google.maps.Marker({
		    position: myLatlng,
		    map: map,
		    title:"Clubline"		    
		});
		
		google.maps.event.addListener(marker, 'click', function() {
			infowindow.open(map, marker);
		})
				
    }
});



