//////////////////////////////////////////////////////////////////////////////////////////////////
																		//
var d = document;														//
																		//
//////////////////////////////////////////////////////////////////////////////////////////////////
var tPh=0;
var Ts;
var T;
var i = 0;
var ttt;
var indnews = 1;
var is_one = 0;
var inTO;
var go=0;
var rol=1;
var ror=0;
var l=-1;
var t;

function phg(num) {
	if(num!=tPh && d.getElementById('ph'+num)) {
		d.getElementById('ph'+tPh).className='dn';
		d.getElementById('ph'+num).className='';
		tPh=num;
	}
} 

function show_menu(id) {
	if (T) clearTimeout(T);
	for (var i=0; i<10 ; i++ ) {
		if(d.getElementById('li_'+i)) d.getElementById('li_'+i).className = '';
	}
	d.getElementById(id).className = 'aktive';
	//d.getElementById('soldt').style.position = 'static';
	//d.getElementById(\'soldt\').style.position = \'relative\';
}

function hid_menu(id) {
	T = setTimeout('document.getElementById(\''+id+'\').className = \'\'; ', 500);
}

function indnewsShow(id, tr) {
	if (indnews != id && indnews > 1) {
		indnewsItemHide(indnews);
	}
	d.getElementById('newsdescr1').className = '';
	d.getElementById('news1').className = '';
	window.clearTimeout(inTO);
	if (d.getElementById('newsdescr'+id)) {
		d.getElementById('newsdescr'+id).className = 'descr';
		d.getElementById('lfc').className = 'lft_clmn';
		if (!tr) {
			d.getElementById('news'+id).className = 'selected';
			d.getElementById('lfc').className = 'lft_clmn';
		} else {
			d.getElementById('news'+id).className = 'selectedlast';
			d.getElementById('lfc').className = 'lft_clmn1';
		}
		indnews = id;
	}
}
function indnewsItemHide(id) {
	if (d.getElementById('newsdescr'+id) ) {
		d.getElementById('newsdescr'+id).className = '';
		d.getElementById('news'+id).className = '';
		d.getElementById('news1').className = 'selected';
		d.getElementById('newsdescr1').className = 'descr';
	}
}
function indnewsHide(id) {
	if (d.getElementById('newsdescr'+id)) {
		inTO = window.setTimeout('indnewsItemHide('+id+')', 500);
	}
}
function clr() { if (inTO) clearTimeout(inTO);}

function overauto(id) {
	if (ttt) clearTimeout(ttt); 
	if (d.getElementById('cnt_' + id)) d.getElementById('cnt').innerHTML = d.getElementById('cnt_' + id).innerHTML; 
	for (var i=0; i<20 ; i++ ) {
		if(document.getElementById('jin_'+i)) document.getElementById('jin_'+i).className = '';
	}
	d.getElementById('jin_' + id).className = 'selected';
}
function overautoy(id) {
	if(d.getElementById('cnt')) {
		d.getElementById('cnt').innerHTML = d.getElementById('cnt_' + id).innerHTML;
		for (var i=0; i<20 ; i++ ) {
			if(d.getElementById('jin_'+i)) d.getElementById('jin_'+i).className = '';
		}
		d.getElementById('jin_' + id).className = 'selected';
	}
}
function mdShow() {
    i = 2;
	overautoy(i);
	//i++;
/*	if (i==13) {
		i = 0;
	}
*/
/*
	if (i==6 || i==7) {
		i = 8;
	}
	if (i==12) {
		i = 0;
	}
*/
	//ttt = window.setTimeout('mdShow()', 1500);
}

function HTMLHttpII() {
	// if DOM 2 supports
	if (window.addEventListener) {
		window.addEventListener('load', this.onloadListener, false);
	// if IE
	} else if (window.attachEvent) {
		window.attachEvent('onload', this.onloadListener);
	// DOM 0 support
	} else if (window.onload) {
		window.onload = this.onloadListener;
	}
}
HTMLHttpII.prototype.onloadListener = function() { 
	window.setTimeout('mdShow()', 5000);
}
II = new HTMLHttpII();  

function shhd(id) {
	if (d.getElementById(id).className == 'db') {
		d.getElementById(id).className = 'dn';
	} else {
		d.getElementById(id).className = 'db';
	} 	
}
function ov(id) {
	d.getElementById('tr_' + id).className = 'over';
}
function ot(id) {
	d.getElementById('tr_' + id).className = '';
}
function goautor(){
	clearTimeout(Ts);
	d.getElementById('all_auto').style.display = 'block';
	d.getElementById('main_auto').style.display = 'block';
}
function goauto(){
	clearTimeout(Ts);
	d.getElementById('all_auto').style.display = 'block';
	d.getElementById('main_auto').style.display = 'block';
	d.getElementById('new_auto_1').className = 'sel';
}
function awayautor(){
	clearTimeout(Ts);
	Ts = window.setTimeout('d.getElementById(\'main_auto\').style.display = \'none\';d.getElementById(\'all_auto\').style.display = \'none\';d.getElementById(\'new_auto_1\').className = \'\';', 100);
}
function awayauto(){
	clearTimeout(Ts);
	Ts = window.setTimeout('d.getElementById(\'main_auto\').style.display = \'none\';d.getElementById(\'all_auto\').style.display = \'none\';d.getElementById(\'new_auto_1\').className = \'\';', 100);
}


function hide(id){
	d.getElementById(id).style.display = 'none';
	d.getElementById('main_auto').className = '';
}

function gotoleft() {
	clearTimeout(ttt);
	if (rol) {
		if (!go) {
			go = 1;
			t = l;
			window.setTimeout('goleftu(\'' + t + '\')', 100);
		}
	}
}
function goleftu(l) {
	l = Number(l);
	t = Number(t);
	if ( l > t-233) {
		l = l - 9;
		d.getElementById('slideline').style.left = l + 'px';
		window.setTimeout('goleftu(\'' + l + '\')', 1);
	} else {
		t = l;
		go=0;
		rol=0;
		ror=1;
	}
}
function gotoright() {
	clearTimeout(ttt);
	if (ror) {
		if (!go) {
			go=1;
			window.setTimeout('gorightu(\'' + t + '\')', 100);
		}
	}
}
function gorightu(l) {
	l = Number(l);
	t = Number(t);
	if ( l < t + 233) {
		l = l + 9;
		d.getElementById('slideline').style.left = l + 'px';
		window.setTimeout('gorightu(\'' + l + '\')', 1);
	} else {
		t = l;
		go=0;
		rol=1;
		ror=0;
	}
}
function color(id) {
	d.getElementById('tukte').innerHTML = d.getElementById('te_' + id).innerHTML;
	d.getElementById('tti').innerHTML = d.getElementById('tet_' + id).innerHTML;
	for (var i=0; i<20 ; i++ ) {
		if(d.getElementById('selec_' + i)) d.getElementById('selec_'+i).className = '';
	}
	if(d.getElementById('selec_' + id)) d.getElementById('selec_'+id).className = 'selected';
}
function gallery(id) {
	d.getElementById('tukter').style.marginTop = '-' + 306*id + 'px';
	for (var i=0; i<20 ; i++ ) {
		if(d.getElementById('selec_' + i)) d.getElementById('selec_'+i).className = '';
	}
	if(d.getElementById('selec_' + id)) d.getElementById('selec_'+id).className = 'selected';
}
