Сообщение от soltx
|
объясни почему этот код не работает
|
Ага, объясни, почему этот код не работает:
throw "ERROR"
var rows=document.getElementsByTagName("tr");var j=0;var row=false;var item=false;var imglist=false;var attr="";var change=false;var found=false;var tcat=false;for(var i=0;i<rows.length;i++)
{row=rows[i];if(!row.className||row.className=='')
{change=false;tcat=false;for(j=0;j<row.childNodes.length;j++)
{item=row.childNodes[j];if(item.className&&item.className=='thead')
{change=true;}
if(item.className&&item.className=='tcat')
{if(tcat)
{item.className='tcat tcat2';}
tcat=true;}}
if(change)
{row.className='thead-row';imglist=row.getElementsByTagName("img");for(j=0;j<imglist.length;j++)
{attr=imglist.item(j).src;if(attr.indexOf('menu_open.gif')>0)
{attr=attr.replace(/menu_open.gif/,'menu_open2.gif');imglist.item(j).src=attr;}}}}
if(row.className&&row.className=='vbmenu_dark')
{imglist=row.getElementsByTagName("img");for(j=0;j<imglist.length;j++)
{attr=imglist.item(j).src;if(attr.indexOf('menu_open.gif')>0)
{attr=attr.replace(/menu_open.gif/,'menu_open2.gif');imglist.item(j).src=attr;}}}}
item=document.getElementById('posts');if(item)
{rows=item.getElementsByTagName('table');if(rows&&rows.length>1&&rows[1].className&&rows[1].className==='tborder')
{rows[1].style.borderTopWidth='0';}}
item=document.getElementById('post');if(item&&item.className&&item.className==='tborder')
{item.style.borderTopWidth='0';}
ca_parse_bbcode_block(document);function ca_parse_bbcode_block(parent)
{rows=parent.getElementsByTagName("table");for(i=0;i<rows.length;i++)
{ca_parse_bbcode_table(rows[i]);}}
function ca_parse_bbcode_table(row)
{return
if(row.className&&row.className=='bbcode-rounded bbcode-rounded-code')
{item=row.parentNode;if(item.offsetWidth==row.offsetWidth&&item.offsetWidth>0)
{change=row.offsetWidth- 40;if(item.className&&item.className=='bbcode-rounded-content')
{change=change- 10;}
row.style.width=change+'px';imglist=row.getElementsByTagName('pre');if(imglist.length)
{imglist[0].style.width=(change- 8)+'px';}}
else
{change=item.offsetWidth- 40- row.offsetWidth;if(change>10)
{if(item.className&&item.className=='bbcode-rounded-content')
{change=change- 10;}
row.style.width=(row.offsetWidth+ change)+'px';imglist=row.getElementsByTagName('pre');if(imglist.length)
{imglist[0].style.width=(imglist[0].offsetWidth+ change- 8)+'px';}}}}
if(row.className&&row.className=='bbcode-rounded bbcode-rounded-quote')
{item=row.parentNode;if(item.offsetWidth==row.offsetWidth&&item.offsetWidth>0)
{change=row.offsetWidth- 40;if(item.className&&item.className=='bbcode-rounded-content')
{change=change- 10;}
row.style.width=change+'px';}
else
{change=item.offsetWidth- 40- row.offsetWidth;if(change>10)
{if(item.className&&item.className=='bbcode-rounded-content')
{change=change- 10;}
row.style.width=(row.offsetWidth+ change)+'px';}}}}
var ca_bbcode_parsed=true;