function calendar_popup_color(object){
	var tablemain = document.getElementById('popup_table_calendar');	
	if (object.className == 'good') {
		tablemain.setAttribute("class",'good_table');
		tablemain.setAttribute("className",'good_table');		
	} else if (object.className == 'best') {
		tablemain.className='best_table';
	} else if (object.className == 'fair') {
		tablemain.className='fair_table';
	} else if (object.className == "poor") {
		tablemain.className='poor_table';
	}
}

var detached = false;

$(document).ready(function() {

  $(window).scroll(function() {
    if(!detached && $(window).scrollTop() > 440) {
      $('.calendar_months').css('position','fixed');
      $('.calendar_months').css('top','0px');
      detached = true;
	  
	  $('.droppable').css('position','fixed');
      $('.droppable').css('top','0px');
      $('.droppable').css('left','50px');
      detached = true;
    }
    else if(detached && $(window).scrollTop() <= 440) {
      $('.calendar_months').css('position','relative');
      detached = true;
      $('.droppable').css('position','relative');
      $('.droppable').css('top','0px');
      $('.droppable').css('left','0px');
      detached = false;
    }
    /*
    else if(position != 1 && $(window).scrollTop() > 50 && $(window).scrollTop() < 200) {
      $('.calendar_months').animate({top: '150px'}, 500); 
      position = 1; 
    }
    else if(position != 2 && $(window).scrollTop() > 200 && $(window).scrollTop() < 350) {
      $('.calendar_months').animate({top: '250px'}, 500); 
      position = 2; 
    }
    */
      
  });

});