var script_ks_c = 3; 
var script_ks_next_blok = 1; 
var script_ks_blok = new Array();
		
		
script_ks_blok[0] = '<td valign=top width=100><a href="http://localhost/_avito_new/items/prodayu_2_komn_kvartiru_75_kv_m_65"><img border=0 src="http://localhost/_avito_new/foto/97/197s.jpg" ></a><br><a href="http://localhost/_avito_new/items/prodayu_2_komn_kvartiru_75_kv_m_65">Продаю 2-комн квартиру 75 кв м</a><br><br></td>';
script_ks_blok[1] = '<td valign=top width=100><a href="http://localhost/_avito_new/items/prodayu_studiya_kvartiru_35_kv_m_64"><img border=0 src="http://localhost/_avito_new/foto/96/196s.jpg" ></a><br><a href="http://localhost/_avito_new/items/prodayu_studiya_kvartiru_35_kv_m_64">Продаю  студия квартиру 35 кв м</a><br><br></td>';
script_ks_blok[2] = '<td valign=top width=100><a href="http://localhost/_avito_new/items/prodayu_1_komn_kvartiru_55_kv_m_45"><img border=0 src="http://localhost/_avito_new/foto/94/194s.jpg" ></a><br><a href="http://localhost/_avito_new/items/prodayu_1_komn_kvartiru_55_kv_m_45">Продаю 1-комн квартиру 57 кв м</a><br><br></td>';
script_ks_blok[3] = '<td valign=top width=100><a href="http://localhost/_avito_new/items/%D0%BF%D1%80%D0%BE%D0%B4%D0%B0%D0%B5%D1%82%D1%81%D1%8F_bmw_z8_3"><img border=0 src="http://localhost/_avito_new/foto/84/184s.jpg" ></a><br><a href="http://localhost/_avito_new/items/%D0%BF%D1%80%D0%BE%D0%B4%D0%B0%D0%B5%D1%82%D1%81%D1%8F_bmw_z8_3">BMW Z8,  2011 г.  58000 км</a><br><br></td>';
script_ks_blok[4] = '<td valign=top width=100><a href="http://localhost/_avito_new/items/nayden_pasport_44"><img border=0 src="http://localhost/_avito_new/foto/79/179s.jpg" ></a><br><a href="http://localhost/_avito_new/items/nayden_pasport_44">Найден паспорт</a><br><br></td>';

var script_ks_len=script_ks_blok.length;

if(script_ks_next_blok==1)
	{
	Array.prototype.shuffle = function( b ){ var i = this.length, j, t; while( i )  {  j = Math.floor( ( i-- ) * Math.random() );  t = b && typeof this[i].shuffle!=='undefined' ? this[i].shuffle() : this[i];  this[i] = this[j];  this[j] = t; } return this;};
	script_ks_blok.shuffle();
	}

var script_ks_begin = script_ks_c;
var script_ks_end = 0;
var script_ks_a = '';
var script_ks_end_2=0;

var script_ks_b="<table><tr>";
for(var j=0; j<script_ks_c; j++)
	{
	script_ks_b=script_ks_b+script_ks_blok[j];
	}
script_ks_b=script_ks_b+"</tr></table>";
			
function toNext() {
if(script_ks_begin == script_ks_len) 
	{
	script_ks_begin=0;
	}
		
script_ks_end = script_ks_begin+script_ks_c;
if(script_ks_end > script_ks_len)
	{
	script_ks_end_2 = script_ks_end - script_ks_len;
	script_ks_end = script_ks_len;
	}
				
script_ks_a = "<table ><tr>";
for(i = script_ks_begin; i < script_ks_end; i++)
	{
	script_ks_a=script_ks_a+script_ks_blok[i];
	}
script_ks_begin=script_ks_end;

if(script_ks_end_2>0)
	{
	for(var i = 0; i < script_ks_end_2; i++)
		{
		script_ks_a=script_ks_a+script_ks_blok[i];
		}
	script_ks_begin=script_ks_end_2;
	script_ks_end_2=0;
	}
				
script_ks_a=script_ks_a+"</tr></table>";
document.getElementById("script_ks_text").innerHTML=script_ks_a; 
}

document.write('<div id="script_ks_text" >');
document.write(script_ks_b);
document.write('</div>');

function start_viget()
	{
   	setInterval('toNext()',6000);
	}
	
if (script_ks_next_blok==1)
	{
	start_viget();
	}



		