function getHTTPObject()
{
	// code for Mozilla, etc.
	if (window.XMLHttpRequest)
  	{
  		xmlhttp=new XMLHttpRequest()
  	}
// code for IE
	else if (window.ActiveXObject)
  	{
  		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
  	}
	return xmlhttp;
}
var http = getHTTPObject();

function votenow(id,secid)
{
	var url = SITE_URL+"ajax_files/ajax_votenow.php";
	document.getElementById('secid').value = secid;
	url = url + "?id="+id;
	http.open("GET", url, true);
	http.onreadystatechange = getvotes;
    http.send(null);
    
}

function getvotes()
{
	if (http.readyState == 4)
	{
   		var responce = http.responseText;
   		if(responce == 'registered')
   		{
            window.open('index.php?file=c-thankyou','enlarged_view','toolbar=no,resizable=no,scrollbars=no,width=400, height=395,  top=160, left=290'); return false;   
        }
        else
        {
   		    vote_str = responce.split('||');
   	    	secid1  = parseInt(document.getElementById('secid').value);
            str1[secid1].countTo(vote_str[1]);
            document.getElementById('votesubmit'+vote_str[0]).value='vote registered';
        }
	}
}

function getGlobal(){
return (function(){
return this;
}).call(null);
}


