// JavaScript Document
$(document).ready(function(){
	
	$('.event_href').unbind('click');
	var items = $('.event_href').get();
	
	$('.event_href').click(function(event){
    	event.stopPropagation();
    	event.preventDefault();
    	this.blur();
    	$('div[@id^=event_desc]').hide();
    	var hrefid = this.id;
    	$('#event_desc'+hrefid).show();
    	var test_min = $(this).attr('min');
    	var test_max = $(this).attr('max');
    	var item;
    	for (var i=0; item=items[i]; i++)
			{
        	var min = $(item).attr('min');
        	var max = $(item).attr('max');
			if ((min <= test_max && min >= test_min) || (max <= test_max
&& max >=test_min)) 
				{
                $(item).parent().parent().parent().parent().children().children().children().children('h3').css({"color":"blue"});
        		}
        	else 
				{
				$(item).parent().parent().parent().parent().children().children().children().children('h3').css({"color":"#8D0000"});
        		}
    		}
    	return false;
	});
	
	$('.open_section').click(function(event){
		event.stopPropagation();
		event.preventDefault();
		this.blur();
		var hrefid = this.id.substr(this.id.length - 1);
 		$('#section'+hrefid).show(); 
 		$('#closesection'+hrefid).show();
		$('#opensection'+hrefid).hide(); 
		return false;
	});

	$('.close_section').click(function(event){
		event.stopPropagation();
		event.preventDefault();
		this.blur();
		var hrefid = this.id.substr(this.id.length - 1);
 		$('#section'+hrefid).hide(); 
 		$('#closesection'+hrefid).hide();
		$('#opensection'+hrefid).show(); 
		return false;
	});
	
});