
  function valid(text,type){
    switch(type){
      case 'login': var regex = /^[a-zA-Z0-9_-]{6,32}$/; break;
      case 'password': var regex = /^[a-zA-Z0-9_-]{6,32}$/; break;
      case 'email': var regex = /^[0-9a-z]+([\.\-_][0-9a-z]+)*\@[0-9a-z]+([\.\-][0-9a-z]+)*\.([a-z]{2,4})$/; break;
      case 'numeric': var regex = /^[0-9]/; break;
      default: var regex = /^[a-zA-Z0-9_-]{6,32}$/;
    }
    return regex.test(text);
  }
  
  function menu(deniedId){
    $(document).ready(function(){
      var deniedStr = '';
      if(deniedId != 0) deniedStr = '[id!=tm_'+deniedId+']';
      $('div#menu table td'+deniedStr).hover(
          function(){
            $(this).addClass('lmactive');
            $(this).find('h2').addClass('rmactive');
          },
          function(){
            $(this).removeClass();
            $(this).find('h2').removeClass();
          }      
      );  
    });
  }

  $(function($) {
    $('.jclock').jclock();
  });
  
  $(document).ready(function(){
    
    $('.normal, .normal2').hover(
    function(){
        $(this).attr('class', 'selected3');
        /*$(this).fadeIn(1000)*/
        $(this).show()
    },
    function(){
            $(this).attr('class','normal');            
    })

    /*$('.normal2').click(function(){
      $('.normal2').show();
      $('.selected').hide();
      $(this).hide();
      $(this).next().show();
    });*/
        
    $('.fschangesize span').click(function(){
      $('.fschangesize span').not(this).css('text-decoration','none');
      $(this).css('text-decoration','underline');
      var fid = $(this).attr('id');
      if(fid == 'fsnormal'){
        $('div.content').css({'font-size':'100%','line-height':'18px'});
      } else if(fid == 'fsbigger') {
        $('div.content').css({'font-size':'120%','line-height':'20px'});
      } else if(fid == 'fsbiggest') {
        $('div.content').css({'font-size':'140%','line-height':'22px'});
      }
    });
    
    $('table#gallerytable td').hover(function(){$(this).css('background-color','#ffffff');},function(){$(this).css('background-color','transparent');});
       
    $('span.switchnews').click(function(){
    
        var newssiteid = $(this).attr('id').split('_')[1];
        $('div.annitem:has(a.newslink)').not('div#ann_'+newssiteid).slideUp('slow');
        $('div#ann_'+newssiteid).slideDown('slow');
        
        $('span.switchnews').not(this).css('color','');
        $(this).css('color','#f55d22');
      
    });
    
    $('span#switchnews_1').css('color','#f55d22');
    
  });
  
