 $(document).ready(function()
{

     url=location.href;
   u=url.split('#');
   if (u.length >1) {url=u[0];tab=u[1];} else tab='tab_0';
   if (url.indexOf('daily')> 0 )
      {

           url=url.replace(/daily/,"hourly");   

      }
      else
   if (url.indexOf('hourly')> 0 ) url=url.replace(/hourly/,'daily');
   $('.weatherTable .see' ).attr('href',url+'#'+tab);



   $(".weatherTable .menu li")

    .click(
      function () {
          if ($(this).find('a').length) {return;}
          $(".weatherTable .menu li.select").removeClass('select');
          $(this).parents('.menu').find('li').removeClass('select');
           $('.selectc2').removeClass('selectc2');

          $(this).addClass('select');
          id=$(this).attr('id');
          tab=id;
          $('.weatherTable .see' ).attr('href',url+'#'+tab);

          $('.tabsTable').hide();

          $('.'+$(this).attr('id')).show();


          if ($(this).attr('id') == 'tab_2')
              {
                  $(this).addClass('selectc2');
              }


          $('.hover').removeClass('hover');
          $('.hoverweekend').removeClass('hoverweekend');
        }


    );

    $(".calendW td,.weatherTable .menu li").hover(
      function () {
          $('.hover').removeClass('hover');
          $('.hoverweekend').removeClass('hoverweekend');
         if ($(this).hasClass('select')) return;
         if ($(this).parent().hasClass('head')) return;
         $(this).addClass('hover');
         if ($(this).hasClass('c6') || $(this).hasClass('c7') )$(this).addClass('hoverweekend');

      },
      function () {
         if ($(this).hasClass('select')) return;
         if ($(this).parent().hasClass('head')) return;
         $(this).removeClass('hover');
         $(this).removeClass('hoverweekend');
      }
    );


     $('#'+tab).click();


$('tr.agregator').click(function(){
 $(this).parents('table').find('.select').removeClass('select')
 $(this).parent().addClass('select');





})




 /*
    i0=0;
    n=$('.weatherTable .menu li i').length;
    list(0);

    function list(step)
    {
       $('.weatherTable .menu li').removeClass('disabled');
       $('.weatherTable .menu li i').parents('li').hide();

       i0=i0+step*3;
       if (i0<=0) {$(".updn a#up").parent().addClass('disabled');i0=0;}
       if (i0>=n-3) {$(".updn a#dn").parent().addClass('disabled');i0=n-3;}
       for (i=0;i<3;i++)
       {
          ii=i0+i;
          q=$('li#tab_'+ii);
          if (q.length)
            {   q.show();
                if (i == 0) q.click();
            }

       }

    }


    $(".updn a#up").click(function () {list(-1);return false;});
    $(".updn a#dn").click(function () {list(1);return false;});




    $(".weatherTable .menu li")

    .click(
      function () {
          if ($(this).find('a').length) {return;}
          $(this).parents('.menu').find('li').removeClass('select');
          $(this).addClass('select');
          id=$(this).attr('id');
          $('.tabsTable').hide();
          $('.'+$(this).attr('id')).show();

          if ($(this).hasClass('c2')) {$(this).addClass('selectc2'); }

        }


    );

   $('.full10 tr').click(function()

    {
       if ($(this).parent().hasClass('select') )    return;
       $('.full10 tbody').removeClass('select');
       $(this).parent().addClass('select');
    }
   )
 */


})


