function estd_changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}

function estd_fade_out (estd_id_fout, estd_id_fin, estd_id_pos, estd_id_pos_ant) {
	//document.getElementById(estd_id_fout).style.display="none";
	//setTimeout("alert('qqwqwqw')", 2000);
	//alert(estd_id_pos);
	document.getElementById("pos"+estd_id_pos).setAttribute("class", "navSliderOn");
	//alert(estd_id_pos_ant);
	document.getElementById("pos"+estd_id_pos_ant).setAttribute("class", "navSlider");
	var ttt=30;
	setTimeout(function() {estd_changeOpac(90,estd_id_fout)}, ttt);
	setTimeout(function() {estd_changeOpac(80,estd_id_fout)}, ttt*2);
	setTimeout(function() {estd_changeOpac(70,estd_id_fout)}, ttt*3);
	setTimeout(function() {estd_changeOpac(60,estd_id_fout)}, ttt*4);
	setTimeout(function() {estd_changeOpac(50,estd_id_fout)}, ttt*5);
	setTimeout(function() {estd_changeOpac(40,estd_id_fout)}, ttt*6);
	setTimeout(function() {estd_changeOpac(30,estd_id_fout)}, ttt*7);
	setTimeout(function() {estd_changeOpac(20,estd_id_fout)}, ttt*8);
	setTimeout(function() {estd_changeOpac(10,estd_id_fout)}, ttt*9);
	
	setTimeout("document.getElementById('"+estd_id_fout+"').style.display='none'",ttt*10);
	setTimeout(function() {estd_changeOpac(0,estd_id_fin)}, ttt*5);
	setTimeout("document.getElementById('"+estd_id_fin+"').style.display=''",ttt*5);

	setTimeout(function() {estd_changeOpac(10,estd_id_fin)}, ttt*6);
	setTimeout(function() {estd_changeOpac(20,estd_id_fin)}, ttt*7);
	setTimeout(function() {estd_changeOpac(30,estd_id_fin)}, ttt*8);
	setTimeout(function() {estd_changeOpac(40,estd_id_fin)}, ttt*9);
	setTimeout(function() {estd_changeOpac(50,estd_id_fin)}, ttt*10);
	setTimeout(function() {estd_changeOpac(60,estd_id_fin)}, ttt*11);
	setTimeout(function() {estd_changeOpac(70,estd_id_fin)}, ttt*12);
	setTimeout(function() {estd_changeOpac(80,estd_id_fin)}, ttt*13);
	setTimeout(function() {estd_changeOpac(90,estd_id_fin)}, ttt*14);
	setTimeout(function() {estd_changeOpac(100,estd_id_fin)}, ttt*15);
		//setTimeout( "estd_fade_in ('"+estd_id_fin+"')", 1000)
	//estd_fade_in (estd_id_fin);
}


function estd_fade_man(estd_fade_pos_man) {
	//estd_fade_co
	document.getElementById('estd_fade_co').value=0;
	//estd_fade_pos
	document.getElementById('estd_fade_pos_ant').value=document.getElementById('estd_fade_pos').value;
	document.getElementById('estd_fade_pos').value=estd_fade_pos_man;
	document.getElementById('estd_fade_next').value=estd_fade_arr[estd_fade_pos_man];
	estd_fade_tr();
}

function estd_fade_tr() {
	clearTimeout(estd_t);
	var estd_id_in=document.getElementById('estd_fade_next').value;
	var estd_id_out=document.getElementById('estd_fade_curr').value;
	//estd_fade_pos
	//alert('qwe');//
	//document.getElementById(estd_id_out).style.display="none";
	estd_fade_out(estd_id_out, estd_id_in, document.getElementById('estd_fade_pos').value, document.getElementById('estd_fade_pos_ant').value);
	//document.getElementById(estd_id_in).style.display="";
	document.getElementById('estd_fade_curr').value=document.getElementById('estd_fade_next').value;
	estd_t=setTimeout("estd_fade_to()",1000);
	
}


function estd_fade_to () {
	estd_i=parseInt(document.getElementById('estd_fade_co').value)+1;
	document.getElementById('estd_fade_co').value=estd_i;	
	if (estd_i>estd_dur) {
		document.getElementById('estd_fade_co').value=0
		estd_j=parseInt(document.getElementById('estd_fade_pos').value)+1;
		if (estd_j>=estd_fade_arr.length) {
			estd_j=0;	
		}
		//alert(estd_j+':'+estd_fade_arr[estd_j]);
		//estd_fade_pos
		document.getElementById('estd_fade_pos_ant').value=document.getElementById('estd_fade_pos').value;
		document.getElementById('estd_fade_pos').value=estd_j;
		document.getElementById('estd_fade_next').value=estd_fade_arr[estd_j];
		estd_fade_tr();
	} else {
		estd_t=setTimeout("estd_fade_to()",1000);
	}
}

