var i_strngth=(document.getElementById)?0:1;
var i_image=0
var srcArr= new Array()
/*srcArr[0]="http://www.deka.dn.ua/searchresult.php?marka=323&cat=1" ;
srcArr[1]="http://www.deka.dn.ua/searchresult.php?marka=89&cat=1";
srcArr[2]="http://www.deka.dn.ua/searchresult.php?marka=1&coll_value=7&people_type=1";
srcArr[3]="http://www.deka.dn.ua/searchresult.php?marka=336&cat=1";
srcArr[4]="http://www.deka.dn.ua/searchresult.php?marka=323&cat=1" ;
srcArr[5]="http://www.deka.dn.ua/searchresult.php?marka=1&coll_value=7&people_type=1";
srcArr[6]="http://www.deka.dn.ua/searchresult.php?marka=336&cat=1";
srcArr[7]="http://www.deka.dn.ua/searchresult.php?marka=357&cat=1";
srcArr[8]="http://www.deka.dn.ua/alfex-brand_119.php";
srcArr[9]="http://www.deka.dn.ua/searchresult.php?marka=27&cat=1";
srcArr[10]="http://www.deka.dn.ua/searchresult.php?marka=111&cat=1";
srcArr[11]="http://www.deka.dn.ua/searchresult.php?marka=322&cat=1";
srcArr[12]="http://www.deka.dn.ua/searchresult.php?marka=129&cat=1";*/
srcArr[0]="http://www.deka.dn.ua/alfex/5671_790-watch_380521.php";
srcArr[1]="http://www.deka.dn.ua/alfex/5629_794-watch_380481.php";
srcArr[2]="http://www.deka.dn.ua/alfex/5667_771-watch_380509.php";
srcArr[3]="http://www.deka.dn.ua/alfex/5680_782-watch_380533.php";
srcArr[4]="http://www.deka.dn.ua/alfex/9010_762-watch_380536.php";
srcArr[5]="http://www.deka.dn.ua/alfex/5686_769-watch_380581.php";

var imageurl = new Array()
/*imageurl[0] ="http://www.deka.dn.ua/images/gfx/header/epos_1.jpg";
imageurl[1] ="http://www.deka.dn.ua/images/gfx/header/rado_1.jpg";
imageurl[2] ="http://www.deka.dn.ua/images/gfx/header/casio_2.jpg";
imageurl[3] ="http://www.deka.dn.ua/images/gfx/header/bruno_1.jpg";
imageurl[4] ="http://www.deka.dn.ua/images/gfx/header/epos_2.jpg";
imageurl[5] ="http://www.deka.dn.ua/images/gfx/header/casio_1.jpg";
imageurl[6] ="http://www.deka.dn.ua/images/gfx/header/bruno_2.jpg";
imageurl[7] ="http://www.deka.dn.ua/images/gfx/header/piere_1.jpg";
imageurl[8] ="http://www.deka.dn.ua/images/gfx/header/alfex_1.jpg";
imageurl[9] ="http://www.deka.dn.ua/images/gfx/header/longines_1.jpg";
imageurl[10] ="http://www.deka.dn.ua/images/gfx/header/tag_1.jpg";
imageurl[11] ="http://www.deka.dn.ua/images/gfx/header/christina_1.jpg";
imageurl[12] ="http://www.deka.dn.ua/images/gfx/header/atlantic_1.jpg";*/
imageurl[0] ="http://www.deka.dn.ua/images/gfx/header/635x209_Alfex.jpg";
imageurl[1] ="http://www.deka.dn.ua/images/gfx/header/635x209_Alfex4.jpg";
imageurl[2] ="http://www.deka.dn.ua/images/gfx/header/635x209_Alfex2.jpg";
imageurl[3] ="http://www.deka.dn.ua/images/gfx/header/635x209_Alfex5.jpg";
imageurl[4] ="http://www.deka.dn.ua/images/gfx/header/635x209_Alfex3.jpg";
imageurl[5] ="http://www.deka.dn.ua/images/gfx/header/635x209_Alfex6.jpg";

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;
};

/*var imageindex=new Array(0,1,2,3,4,5,6,7,8,9,10,11,12);*/
var imageindex=new Array(0,1,2,3,4,5);
imageindex.shuffle();

function showimage() {
	if(document.all) {
		if (i_strngth <=110) {
			document.getElementById('testimage').innerHTML="<img style='filter:alpha(opacity="+i_strngth+"); margin-left:10px; width:632px;' onclick='window.open(\""+srcArr[imageindex[i_image]]+"\")' src="+imageurl[imageindex[i_image]]+" border=0>";
			i_strngth=i_strngth+10
			var timer=setTimeout("showimage()",100)
		}
		else {
			clearTimeout(timer)
			var timer=setTimeout("hideimage()",5000)
		}
	}
	if (document.getElementById&&!document.all)
	{

		if (i_strngth <1) {
			document.getElementById('testimage').innerHTML="<a href='"+srcArr[imageindex[i_image]]+"'><img style='opacity:"+i_strngth+"; margin-left:10px; width:632px;' src="+imageurl[imageindex[i_image]]+" border=0></a>";
			i_strngth=i_strngth+0.1
			var timer=setTimeout("showimage()",100)
		}
		else {

			clearTimeout(timer)
			var timer=setTimeout("hideimage()",5000)
		}
	}

	if(document.layers) {
		clearTimeout(timer)
		document.testimage.document.write("<img src="+imageurl[imageindex[i_image]]+" border=0>")
		document.close()
		i_image++;
		if (i_image >= imageurl.length) {i_image=0}
		var timer=setTimeout("showimage()",10000)

	}

}


function hideimage() {
	if (document.all&&i_strngth >=-10) {
		document.getElementById('testimage').innerHTML="<img style='filter:alpha(opacity="+i_strngth+"); margin-left:10px; width:632px;' src="+imageurl[imageindex[i_image]]+" border=0>";
		i_strngth=i_strngth-10
		var timer=setTimeout("hideimage()",100)
	}
	else if(document.getElementById&&!document.all&&i_strngth>0.1)
	{

		document.getElementById('testimage').innerHTML="<a href='"+srcArr[imageindex[i_image]]+"'><img style='opacity:"+i_strngth+"; margin-left:10px; width:632px;' src="+imageurl[imageindex[i_image]]+" border=0></a>";
		i_strngth=i_strngth-0.1;
		var timer=setTimeout("hideimage()",100)
	}
	else {

		clearTimeout(timer)
		i_image++;
		if (i_image >= imageurl.length) {i_image=0}
		i_strngth=(document.getElementById)?0:1;
		if (document.getElementById&&!document.all)
		showimage();
		else
		var timer=setTimeout("showimage()",500)

	}
}

function randomNumber (m,n)
{
	m = parseInt(m);
	n = parseInt(n);
	return Math.floor( Math.random() * (n - m + 1) ) + m;
}
