
function http()
{
	var http ;
	if(window.XMLHttpRequest)
	{
		http = new XMLHttpRequest() ;
	}
	else if(window.ActiveXObject)
	{
		http = new ActiveXObject("Microsoft.XMLHTTP") ;
	}	
	
	return http ;
}

window.onload = function() {

	var elem1 = document.getElementById("vote_logv1") ;
	var elem2 = document.getElementById("vote_logv2") ;

	var elem3 = document.getElementById("vote_logg1") ;
	var elem4 = document.getElementById("vote_logg2") ;

	if(elem1 && elem2)
	{
		for(var i = 0 ; i < elem1.childNodes.length ; i++)
		{
			var node = elem1.childNodes[i] ;
			if(node.nodeType == 1)
			{
				node.onclick = function() { 
											var idP = this.attributes.getNamedItem('id').value ; 
											var idPoints = idP.split(":") ;	
											var url = "/voting/video/" + idPoints[0] + "?points=" + idPoints[1] ;
											var xhdr = http() ;
											this.parentNode.parentNode.style.display = "none" ;
											if(xhdr)
											{
												xhdr.open("GET" , url , true) ;
												xhdr.send(null) ;
											}
							   };
			}
		}

		for(var j = 0 ; j < elem2.childNodes.length ; j++)
		{
			var node = elem2.childNodes[j] ;
			if(node.nodeType == 1)
			{
				node.onclick = function() { 
											var idP = this.attributes.getNamedItem('id').value ; 
											var idPoints = idP.split(":") ;	
											var url = "/voting/video/" + idPoints[0] + "?points=" + idPoints[1] ;
											var xhdr = http() ;
											this.parentNode.parentNode.style.display = "none" ;
											if(xhdr)
											{
												xhdr.open("GET" , url , true) ;
												xhdr.send(null) ;
											}
							   };
			}
		}
	}

	if(elem3 && elem4)
	{
		for(var i = 0 ; i < elem3.childNodes.length ; i++)
		{
			var node = elem3.childNodes[i] ;
			if(node.nodeType == 1)
			{
				node.onclick = function() { 
											var idP = this.attributes.getNamedItem('id').value ; 
											var idPoints = idP.split(":") ;	
											var url = "/voting/gallery/" + idPoints[0] + "?points=" + idPoints[1] ;
											var xhdr = http() ;
											this.parentNode.parentNode.style.display = "none" ;
											if(xhdr)
											{
												xhdr.open("GET" , url , true) ;
												xhdr.send(null) ;
											}
							   };
			}
		}

		for(var j = 0 ; j < elem4.childNodes.length ; j++)
		{
			var node = elem4.childNodes[j] ;
			if(node.nodeType == 1)
			{
				node.onclick = function() { 
											var idP = this.attributes.getNamedItem('id').value ; 
											var idPoints = idP.split(":") ;	
											var url = "/voting/gallery/" + idPoints[0] + "?points=" + idPoints[1] ;
											var xhdr = http() ;
											this.parentNode.parentNode.style.display = "none" ;
											if(xhdr)
											{
												xhdr.open("GET" , url , true) ;
												xhdr.send(null) ;
											}
							   };
			}
		}
	}
};


