var txt = [];
var flag;
var sorted;
function weight( str ) {
var retArray = [];
for( var i = 0; i < str.length; i++ ) {
var tmp = str.charCodeAt( i );
if( tmp >= 1046 && tmp < 1078 )
tmp++;
else if( tmp == 1025 )
tmp = 1046;
else if( tmp >= 1078 )
tmp++;
else if( tmp == 1105 )
tmp = 1078;
retArray[ i ] = tmp;
}
return retArray;
}
function fillArray( years, books, authors ) {
this.years = years;
this.yweight = weight( years );
this.books = books;
this.bweight = weight( books );
this.authors = authors;
this.aweight = weight( authors );
}
txt[ 0 ] = new fillArray( "Crypto ++ SDK 3.0", "Copyright © 1997-1999 Sampson Multimedia.", "1997" );
txt[ 1 ] = new fillArray( "Gus", "Gus Communications, Inc.", "2004" );
txt[ 2 ] = new fillArray( "CripKey", "Kenonic Controls Ltd.", "2010" );
txt[ 3 ] = new fillArray( "Microcosm Copy Protection", "Microcosm Copy Protection", "1996" );
txt[ 4 ] = new fillArray( "Dinkey Dongles", "Dinkey Dongles", "2003" );
txt[ 5 ] = new fillArray( "PC Guard", "Copyright © by Blagoje Ceklic", "1998" );
txt[ 6 ] = new fillArray( "SafeSerial OCX для Windows 95, 98, NT, 2000", "Sikander Soft Inc.", "1995" );
txt[ 7 ] = new fillArray( "Wibu — Key", "©1999 Copy-Protection.com.", "1999" );
txt[ 8 ] = new fillArray( "Lock & Key", "Timeless Technologies, Inc.", "2009" );
txt[ 9 ] = new fillArray( "Windows Protection Tool-Kit", "Advanced Software Technologies", "2006" );
txt[ 10 ] = new fillArray( "Hardlock Bistro", "Aladdin Knowledge Systems GmbH & Co.", "2007" );
txt[ 11 ] = new fillArray( "Sheriff", "Acudata Limited", "2002" );
function createTable( cStart, cType, cSize, cChange ) {
var tabbd = document.getElementById( "tablebody" );
if( !tabbd ) {
var table = document.getElementById( "table" );
var tbody = document.createElement( "tbody" );
tbody.id = "tablebody";
table.appendChild( tbody );
tabbd = document.getElementById( "tablebody" );
}
while( tabbd.hasChildNodes() ) {
var tmp = tabbd.childNodes[ 0 ];
tabbd.removeChild( tmp );
}
for( var counter = cStart; eval( counter + cType + cSize ); eval( "counter" + cChange ) ) {
var tr = document.createElement( "tr" );
var td = document.createElement( "td" );
var tdtxt = document.createTextNode( txt[ counter ].years );
td.appendChild( tdtxt );
tr.appendChild( td );
td = document.createElement( "td" );
tdtxt = document.createTextNode( txt[ counter ].books );
td.appendChild( tdtxt );
tr.appendChild( td );
td = document.createElement( "td" );
tdtxt = document.createTextNode( txt[ counter ].authors );
td.appendChild( tdtxt );
tr.appendChild( td );
tabbd.appendChild( tr );
}
}
txt.push(new fillArray( "Drfrfrf", "HBBuede", "2005" ));
createTable( 0, "<", txt.length, "++" );
<table border="1" id="table">
<tr is="formspar">
<td><a href="javascript:allocator( 'yweight' )">Программа</a></td>
<td><a href="javascript:allocator( 'bweight' )">Разработчик</a></td>
<td><a href="javascript:allocator( 'aweight' )">Год создания</a></td>
</tr>
<tbody id="tablebody"></tbody>
</table>
createTable( 0, "<", txt.length, "++" );