 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; 
}

 function banner_count(id){
        ajax=nuevoAjax();
        ajax.open("GET", "includes/banners_count.php?id="+id, true);
        ajax.onreadystatechange=function() 
        { 
       
            if (ajax.readyState==4)
            { 
           
                document.getElementById("featured").innerHTML=ajax.responseText;

            } 
        }
        ajax.send(null);
 }
 
  function loadbanner(id){
        ajax=nuevoAjax();
		
        ajax.open("GET", "includes/banners.php?"+id, true);
        ajax.onreadystatechange=function() 
        { 
       
            if (ajax.readyState==4)
            { 
           
                document.getElementById("featured").innerHTML=ajax.responseText;

            } 
        }
        ajax.send(null);
 }
 
 function loadsearch(what)
 {
 	if(what==1)
 	{
		 document.getElementById("search-link").style.display="none";
		 document.getElementById("login-link").style.display="inline"
		 document.getElementById("login-top").style.display="none";
		 document.getElementById("search").style.display="inline";
		
	} else
			{
				
				document.getElementById("login-link").style.display="none";
				document.getElementById("search-link").style.display="inline";
		   		 document.getElementById("search").style.display="none";
				 document.getElementById("login-top").style.display="inline";
			}
 
 }