function checkajax(type, pid){ 
  if(document.getElementById('frm981')){ 
   if(type=='minus'){ 
    document.getElementById('a1').checked=true; 
    document.getElementById('frm981').reason.value='Тьфу на тебя, за твой ответ в теме: '+eval('url'+pid); 
   }else if(type=='plus'){ 
    document.getElementById('a2').checked=true; 
    document.getElementById('frm981').reason.value='Благодарю за '+prich+'&nbsp;'+eval('url'+pid); 
   } 
   if(confirm('Вы уверены? Многократное нажатие кнопки Спасибо за один и тот же материал запрещено правилами!')) document.getElementById('submfrm981').click(); 
   clearInterval(time); 
   time = null; 
   document.getElementById('submfrm981').disabled=true;
  } 
 } 
 function searchWin(){ 
  if( !document.getElementById('layerContentRh') ) return; 
  if( document.getElementById('layerContentRh').getElementsByTagName('TBODY')[0] ){ 
   var tds = document.getElementById('layerContentRh').getElementsByTagName('td'); 
   for(i=0; i<tds.length; i++){ 
    if(tds[i].getAttribute('id') && tds[i].getAttribute('colspan') && (tds[i].innerHTML.indexOf('http://') != -1) ) { 
     tUrl = tds[i].innerHTML.substring(tds[i].innerHTML.indexOf('http://')); 
     tds[i].innerHTML = tds[i].innerHTML.replace( tUrl, '&nbsp;(<a style="color:#669900" title="Просмотр материала" target="_blank" href="'+tUrl+'">'+tUrl+'</a>)' ); 
    } 
   } 
   clearInterval(timeRep); 
   timeRep = null; 
  } 
 }