$(document).ready(function(){
// CALENDAR

     $('.s_p_c_title .close').bind('click', function () {
            $(this).parents('.s_pop').toggle();
            return false;
    });
    
    $('.e_t_c_td_a .show_e_pop').bind('click', function () {
        $(".s_pop").hide();
        var thePop = $(this).parents('.title').next();
        if(thePop.html()==null||thePop.html()==''){
            $.get("../SocialCalendar.ashx?Id="+$(this).attr("id"), function(data){
              thePop.html(data);
               thePop.css("left",($(window).width()-thePop.width())/2);
                thePop.css("top",($(window).height() - $(".s_p_c",thePop).outerHeight())/2+$(window).scrollTop());
            });
        }
       
        thePop.toggle();
        return false;
    });
   

    $('.e_t_c_td_a .show_a_pop').bind('click', function () {
        $(this).parents('.title').next().toggle();
        return false;
    });
    $('.a_pop_t .close').bind('click', function () {
        $(this).parents('.a_pop').toggle();
        return false;
    });
    $('.show_e_pops').bind('click', function () {
        $(this).parents('.titles').next().toggle();
        return false;
    });
    $('.e_t_c_td').bind('mouseover', function () {
        $(this).addClass("etc");
    });
    $('.e_t_c_td').bind('mouseout', function () {
        $(this).removeClass("etc");
    });
    
    var strs= $("#ctl00_cphContent_Calendar1").children().children();
    for(i=1;i<strs.length;i++){
        strs.eq(i).addClass('e_r_'+i)
    }
    
    
//    $('.pop_prev').click(function(){
//    
//        var pop=$(this).parents('.s_pop');
//        
//        pop.prev().prev().prev().(".e_t_c_td_a .show_e_pop").click();
//        
//        return false;
//    
//    });
    
//     $('.pop_next').click(function(){
//    
//        var pop=$(this).parents('.s_pop');
//        
//        pop.hide();
//        
//        pop.next().(".e_t_c_td_a .show_e_pop").click();
//        
//        return false;
//    
//    });
});
