// если ссылка содержит путь схожий с тем где сейчас находится броузер, то она получит класс act
base=$('base').attr('href');if(base){$('a').each(function(){if(base.indexOf(this.href)>-1)$(this).addClass('act');});}

// если у таблицы установлен бордер, то применяем к ней оформление
$('table[border=1]').attr('border',0).attr('cellspacing',1).attr('class','tline');

// стандартный input:button
$('input[type=button],input[type=submit]').each(function(){
  $(this).wrap('<span>').parent().attr('class','button')
  $(this).focus(function(){
    $(this).blur()
  })
});

// стандартный input:file
$('input:file').wrap('<span>').before('<span>Обзор...</span>').parent().addClass('butfile')
$('input:file').change(function(){
  $(this).parent().css('width',200)
  $(this).parent().find('span').css('width',180).text(this.value.replace(/^.+(\/|\\)/,''))
  $(this).parent().find('input').css('margin','0 0 0 65px')
})

// растягивает сайт по высоте если необходимо
function he(){
  x = (window.innerHeight ? window.innerHeight : document.documentElement.clientHeight)-50; // 50 - это статичная высота
  x = document.getElementById('hif').offsetHeight>x ? document.getElementById('hif').offsetHeight : x;
  if(document.getElementById('hof').style.height!=x){
    document.getElementById('hof').style.height = x+'px';
    win_h = x;
  }
}
//he();setInterval(he,1000);

/* бегущая шапка */
$('.head').css('background-position',0);
i=0;
function he(){
  if(i>800) i=0;
  i+=1;
  $('.head').css('background-position',i);
}
setInterval(he,150);

/* реклама */
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
try {
var pageTracker = _gat._getTracker("UA-10076078-2");
pageTracker._trackPageview();
} catch(err) {}
