// JavaScript Document
function stopFader()
	{
		clearInterval(repeater);
	}
	
	function startFader()
	{
		//fadePref(curent_flash,curent_flash);
		repeater=setInterval("fadeF()",5000);
	}
	
	function changeF(s,h)
	{
		val=counter;
		counter=counter+20;
		
	//	alert(h);
		
	//	alert(counter);
		
		//alert(s);
		document.getElementById(s).style.opacity=val/100;
		document.getElementById(s).style.filter='alpha(opacity = '+val+')';
		
		opac=100-val*1;
		if(opac<0)
			opac=0;
		//alert(opac/100);
		//alert(opac);
		
	//	if(val==55)
		//	alert(opac/100);
			
		
		
		document.getElementById(h).style.opacity=opac/100;
		document.getElementById(h).style.filter='alpha(opacity = '+opac+')';
		
		if(counter>=100)
		{
			counter=0;
			clearInterval(fader);
			document.getElementById(h).style.opacity=0;
			document.getElementById(h).style.filter='alpha(opacity = 1)';
			document.getElementById(h).style.zIndex=0;
			
			document.getElementById(s).style.opacity=1 ;
			document.getElementById(s).style.filter='alpha(opacity = 100)';
			document.getElementById(s).style.zIndex=1;
		} 
	}
	
	function fadePref(s,h)
	{
		var show;
		var hide;
		
		//alert(curent_flash);
		
	//	alert(s);
	//	alert(h);
		counter=0;
		clearInterval(fader);		
		
		show='flash'+s;
		hide='flash'+h;
		
		document.getElementById(hide).style.opacity=1 ;
		document.getElementById(hide).style.filter='alpha(opacity = 100)';
		
		counter=0;
		curent_flash=s;
		
		//alert(curent_flash);
		
		fader=setInterval("changeF('"+show+"','"+hide+"')",10);	
	}
	
	function fadeF()
	{
		var s;
		var show;
		var hide;
		
	//	alert(curent_flash);
		if(curent_flash<total_flash)
			s=curent_flash*1+1;
		else s=1;	
		
		show='flash'+s;
		hide='flash'+curent_flash;
		
	//	alert(show);
	//	alert(hide);
		counter=0;
		curent_flash=s;
		
		fader=setInterval("changeF('"+show+"','"+hide+"')",20);
		
	}
