function rand()

{

	n=Math.floor(Math.random()*pic.length);

	return n;

}



function set()

{

	if(pic[0]== '') {return false;}

	var a = new Array();

	for (var i=0;i<2;i++)

	{

		rand();

		for(var j=0;j<a.length;j++)

		{

			if(n==a[j]){rand()}

		}

		a[i]=n

	}

	var root=document.getElementById('container');

	for(var i=0;i<2;i++)

	{

		var oIma=document.createElement('img');

		oIma.setAttribute('src',url+pic[a[i]]);

		oIma.className='pics';

		root.appendChild(oIma)

	}

	filter()

}



function timer()

{

	setT = setTimeout('filter()',delay)

}



function filter()

{

	var ima = document.getElementById('container').getElementsByTagName('img')[1];

	if(window.sidebar){//Moz

	if(f<=0){clearTimeout(setT);rem(ima)}

	else{timer()}

	ima.style.MozOpacity=f;

	f=f-mozRate;

	}

	else

	{//IE

	if(f<=0){clearTimeout(setT);rem(ima)}

	else{timer()}

	ima.style.filter='alpha(opacity='+(f*100)+')';

	f=f-mozRate;

	}

}



function rem(ima)

{

	var root = document.getElementById('container');

	root.removeChild(ima);

	var oIma=root.getElementsByTagName('img')[0];

	while(oIma.getAttribute('src').indexOf(pic[n])>-1){

	rand(); }

}





f=1;

nIma=document.createElement('img');

nIma.setAttribute('src',url+pic[n]);

nIma.className='pics';

root.insertBefore(nIma,oIma);

setTimeout('filter()',delay2)

}