﻿var time = 1000;
var timeout;


function addOnloadEvent() {
	if ( typeof window.addEventListener != "undefined" ) {
		window.addEventListener( "load", initTO, false );
	}
	else if ( typeof window.attachEvent != "undefined" ) {
		window.attachEvent( "onload", initTO );
	}
	else {
		if ( window.onload != null ) {
			var oldOnload = window.onload;
			window.onload = function ( e ) {
				oldOnload( e );
				window[initTO]();
			}
		}
		else {
			window.onload = initTO;
		}
	}
}

// properties timeout

function initTO() {
	if(document.getElementById("hd_ind_changetext")) {
		var classname = document.getElementById("hd_ind_changetext").className;
		//alert(classname);
		var id = Number(classname.replace('opaa',''));
		//alert(id);
		if (id < 36) {
			
			var idN = id + 1;
			
			//alert(idN);
				if(document.getElementById('opt'+idN)) {
					document.getElementById("hd_ind_changetext").className = "opaa" + idN;
					document.getElementById('opt'+id).style.display = 'none';
					document.getElementById('opt'+idN).style.display = '';
				} else {
					var idN = 1;
					document.getElementById("hd_ind_changetext").className = "opaa" + idN;
					document.getElementById('opt'+id).style.display = 'none';
					document.getElementById('opt'+idN).style.display = '';
				}
		} else {
			var idN = 1;
			//alert(idN);
			document.getElementById("hd_ind_changetext").className = "opaa" + idN;
			document.getElementById('opt'+id).style.display = 'none';
			document.getElementById('opt'+idN).style.display = '';
		}
		
		timeout = setTimeout("initTO()", time);
		
	}
}

//
addOnloadEvent();