function golos(n, id){
	for(i=1; i<=n; i++){
		document.getElementById('golos_'+id+'_'+i).src = '/tmp/img/z2.jpg';
	}
	
	var m = n+1;
	if(m <= 4){
		for(i=m; i<=5; i++){
			document.getElementById('golos_'+id+'_'+i).src = '/tmp/img/z1.jpg';
		}
	}
}

function golos_blur(id){
	document.getElementById('golos_'+id+'_1').src = '/tmp/img/z1.jpg';
	document.getElementById('golos_'+id+'_2').src = '/tmp/img/z1.jpg';
	document.getElementById('golos_'+id+'_3').src = '/tmp/img/z1.jpg';
	document.getElementById('golos_'+id+'_4').src = '/tmp/img/z1.jpg';
	document.getElementById('golos_'+id+'_5').src = '/tmp/img/z1.jpg';
}


//-------------------------------------AJAX--------------------------------------
function getXmlHttp(){
	var xmlhttp;
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
		}
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}

function ajax_tb_change() {
	var xmlhttp = getXmlHttp();
	var url = 'http://' + document.domain + '/modules/topbanners/php/ajax.php?action=tb_change';
	xmlhttp.open('GET', url, false);
	xmlhttp.send(null);
	if(xmlhttp.status == 200) {
		document.getElementById('header-banner').innerHTML = xmlhttp.responseText;
	}
}
