	function setHoroType(horo)
	{
		if (horo < 10)
		{			document.getElementById('horo_common').className = (horo == 1 ? 'gray' : 'mc gr');
			document.getElementById('horo_cook').className = (horo == 2 ? 'gray' : 'mc gr');
			document.getElementById('horo_love').className = (horo == 3 ? 'gray' : 'mc gr');
			document.getElementById('horo_business').className = (horo == 4 ? 'gray' : 'mc gr');
			document.getElementById('horo_health').className = (horo == 5 ? 'gray' : 'mc gr');
		}
		else
			if (horo > 10)
			{				document.getElementById('horo_yesterday').className = (horo == 11 ? 'gray' : 'mc gr');
				document.getElementById('horo_today').className = (horo == 12 ? 'gray' : 'mc gr');
				document.getElementById('horo_tomorrow').className = (horo == 13 ? 'gray' : 'mc gr');
				document.getElementById('horo_after_tomorrow').className = (horo == 14 ? 'gray' : 'mc gr');
			}
		sign = getHoro();
		if (sign > 0)
			callServer(1, sign);
	}

	function setHoro(horo)
	{		for (i = 1; i <= 12; i++)
			document.getElementById('horo_' + i).className = 'horo';
		document.getElementById('horo_' + horo).className = 'horo_mark';
		callServer(1, horo);
	}

	function getHoro()
	{
		for (i = 1; i <= 12; i++)
			if (document.getElementById('horo_' + i).className == 'horo_mark')
				return i;
		return -1;
	}

          /*horo_array  = new Array();
          horo_array [1][1][2] = "Овен  (21.03-20.04)";
          horo_array [2][1][2] = "Телец  (21.04-20.05)";
          horo_array [3][1][2] = "Близнецы  (21.05-21.06))";
          horo_array [4][1][2] = "Рак  (22.06-22.07)";
          horo_array [5][1][2] = "Лев  (23.07-23.08)";
          horo_array [6][1][2] = "Дева  (24.08-23.09)";
          horo_array [7][1][2] = "Весы  (24.09-23.10)";
          horo_array [8][1][2] = "Скорпион  (24.10-22.11)";
          horo_array [9][1][2] = "Стрелец  (23.11-21.12)";
          horo_array [10][1][2] = "Козерог  (22.12-20.01)";
          horo_array [11][1][2] = "Водолей  (21.01-20.02)";
          horo_array [12][1][2] = "Рыбы  (21.02-20.03)";*/

	function updatePage() {
	  if (xmlHttp.readyState == 4)
	  {
	  	var response = xmlHttp.responseText;
	  	if (xmlHttp.status == 200)
			{
	      response = xmlHttp.responseXML.documentElement;
	      var sign = "";
	      var data = "[Отсутствует]";
	      sign = response.getElementsByTagName('sign')[0].firstChild.data;
				if (response.getElementsByTagName('data')[0].firstChild)
					data = response.getElementsByTagName('data')[0].firstChild.data;

				document.getElementById("horo_sign").innerHTML = sign;
				document.getElementById("horo_text").innerHTML = data;
	    }
		}
	}

	function callServer(mode, param)
	{
	  var post;
	  switch (mode)
	  {	  	case 1:
	  	    document.getElementById("horo_text").innerHTML = "Грузим...";
	  		var horo = 1;
	  		var sign = 1;
	  		var date = 0;
	  		horo = (document.getElementById('horo_common').className == "gray") ? 1 : horo;
				horo = (document.getElementById('horo_cook').className == "gray") ? 2 : horo;
				horo = (document.getElementById('horo_love').className == "gray") ? 3 : horo;
				horo = (document.getElementById('horo_business').className == "gray") ? 4 : horo;
				horo = (document.getElementById('horo_health').className == "gray") ? 5 : horo;

	  		date = (document.getElementById('horo_yesterday').className == "gray") ? -1 : date;
	  		date = (document.getElementById('horo_today').className == "gray") ? 0 : date;
	  		date = (document.getElementById('horo_tomorrow').className == "gray") ? 1 : date;
	  		date = (document.getElementById('horo_after_tomorrow').className == "gray") ? 2 : date;
	  		post = "horo=" + escape(horo) + "&sign=" + escape(param) + "&date=" + escape(date);
	  		break;
	  }
	  var url = "http://kemerovo24.ru/xmlprovider.php?mode=" + escape(mode);

	  xmlHttp.open("POST", url, true);
	  xmlHttp.onreadystatechange = updatePage;
	  xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	  xmlHttp.send(post);
	}


	/* Создание нового объекта XMLHttpRequest для общения с Web-сервером */
	var xmlHttp = false;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	try {
	  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
	  try {
	    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	  } catch (e2) {
	    xmlHttp = false;
	  }
	}
	@end @*/

	if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
	  xmlHttp = new XMLHttpRequest();
	}
