﻿function SoporteAjax()
{
    if (typeof XMLHttpRequest == "undefined" && typeof ActiveXObject == "undefined" && window.createRequest == "undefined")
        return false;

	return true;
}

function objetoAjax(){
	var xmlhttp=false;
	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 Votar(id)
{
	inicioruta = "";
	datos = inicioruta + "Vota.aspx?Id=" + id;
	ajax=objetoAjax();
	ajax.open("GET", datos);
	ajax.onreadystatechange=function() 
	{		
		if (ajax.readyState==4) 
			{
				document.getElementById('mensajeVotaciones').innerHTML = ajax.responseText;
				document.getElementById('votar' + id).style.visibility = "hidden";
				document.getElementById('votacion' + id).innerHTML = parseInt(document.getElementById('votacion' + id).innerHTML) + 1;

			}
				
	}

	ajax.send(null);
}

function fbs_click(enlace) {
u=enlace;
t=document.title;
window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
}
function twitter_click(enlace, desc) {
		_descripcion = "Busca, encuentra e inventa cualquier término relacionado con MINI y la MINIVISIÓN del mundo";
		u=enlace;t=document.title;window.open('http://twitter.com/home?status='+encodeURIComponent(u)+' '+_descripcion,'sharer','toolbar=1,status=1');return false;
	}

