
//---------------------------------------------------------------		 
		 function getXmlHttp11(){
		  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 votesnew(param) 
		{
						var golos=document.getElementById("votess"+param);
						var golos_now=golos.innerHTML;
						//alert("golos_now="+golos_now);
		
							urrl="/tv/votes.php";
							var line='line='+encodeURIComponent(param);	

							var req = getXmlHttp11();  
							
							req.onreadystatechange = function() 
							{  
								if (req.readyState == 4) 
								{ 
									if(req.status == 200) 
									{ 
										//alert("Answer: "+req.responseText);
										var fromquery=req.responseText;
										//alert(fromquery);
										
										if(fromquery!="authneed")
										{
												var fromquery1=eval(fromquery);
												
												//alert(fromquery1[0]);
												
													if(fromquery1[0]!=golos_now)
													{
														//alert("da");
														golos.innerHTML=fromquery1[0];
													}
													else
													{
														alert("Сегодня Вы больше не можете голосовать за этот ролик!");
													}
										}
										else
										{
											alert("Вы должны авторизоваться, чтобы голосовать за этот ролик!");
										}
										
									}
								}
							}

							req.open('POST', urrl, true);  							
							req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
							req.send(line);  // отослать запрос										
				
				//alert(param); 
		}
		
