function nuevoAjax()
{ 
    /* Crea el objeto AJAX. Esta funcion es generica para cualquier utilidad de este tipo, por
    lo que se puede copiar tal como esta aqui */
    var xmlhttp=false; 
    try 
    { 
        // Creacion del objeto AJAX para navegadores no IE
        xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
    }
    catch(e)
    { 
        try
        { 
            // Creacion del objet AJAX para IE 
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
        } 
        catch(E) { xmlhttp=false; }
    }
    if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp=new XMLHttpRequest(); } 

    return xmlhttp; 
}

var saveWidth = 0;
function scaleImg(what){
	what = document.getElementById(what);
	if (navigator.appName=="Netscape") winW = window.innerWidth;
	if (navigator.appName.indexOf("Microsoft")!=-1)	winW = document.body.offsetWidth;

	if (what.width>380 || saveWidth>380) {
		if (what.width==380) {
			what.width=saveWidth;
		} else {
			saveWidth = what.width;
			what.style.cursor = "pointer";
			what.width=380;
		}
	}
}



 function votar(idimagen)
{
    document.getElementById("divvoto").innerHTML='Cargando...';
	ajax=nuevoAjax();
	ajax.open("GET", "/ajax_votar.php?idimagen="+idimagen+"&num_ale="+Math.random(), true);
    ajax.onreadystatechange=function() 
    {   
    	if (ajax.readyState==4) { document.getElementById("divvoto").innerHTML=ajax.responseText;  } 
    }
    ajax.send(null);       
}

