/////////////////////////powered by punknomas@hotmail.com/////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////
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 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 show_info(codigo)

{
	 
	divresultado=document.getElementById('infomodelos');

	var Aleatorio=parseInt(Math.random()*99999999);

	ajax=new objetoAjax();

	ajax.open("GET","info_modelos.php?id="+codigo+"&rand=" + Aleatorio,true);

	ajax.onreadystatechange=useHttpResponses;

	ajax.send(null);
}

function enviar()

{
	 mio=document.enviar.mio.value;
	 amigos=document.enviar.amigos.value;
	 comen=document.enviar.comentarios.value;
	 foto=document.frm_ruta.foto.value;
	 
	divresultado=document.getElementById('img_envio');

	var Aleatorio=parseInt(Math.random()*99999999);

	ajax=new objetoAjax();

	ajax.open("GET","envio.php?mio="+mio+"&amigos="+amigos+"&comentarios="+comen+"&foto="+foto+"&rand=" + Aleatorio,true);

	ajax.onreadystatechange=useHttpResponses;

	ajax.send(null);
	alert('La foto fue enviada satisfactoriamente ;)')
}


function show_now(pag)

{
	 
	divresultado=document.getElementById('videomodelos');

	var Aleatorio=parseInt(Math.random()*99999999);

	ajax=new objetoAjax();

	ajax.open("GET",pag +"&rand=" + Aleatorio,true);

	ajax.onreadystatechange=useHttpResponses;

	ajax.send(null);
}


function show_modelos(pagina)
{

setTimeout("show_now('"+pagina+"')",1000);	
}



function show_fiesta_now(pag)

{
	 
	divresultado=document.getElementById('foto');

	var Aleatorio=parseInt(Math.random()*99999999);

	ajax=new objetoAjax();

	ajax.open("GET",pag +"&rand=" + Aleatorio,true);

	ajax.onreadystatechange=useHttpResponses;

	ajax.send(null);
}


function show_fiesta(pagina)
{

setTimeout("show_fiesta_now('"+pagina+"')",1000);	
}


function ver_formulario()
{
	
document.getElementById('formulario_cap').visibility='visible';
document.getElementById('formulario_cap').style.display ='';

document.getElementById('intvideo').visibility='hidden';
document.getElementById('intvideo').style.display ='none';

}

function useHttpResponse() {

	

   if (ajax.readyState == 4) 

   {

   		 if(ajax.status == 200) 

		{

			divresultado.innerHTML=ajax.responseText;

			

		}

  } 

  else 

  {

  divresultado.innerHTML = '<center><p /><img src="images/cargando.gif" alt="cargando..."></center>';

  }


}


function useHttpResponses() {

	

   if (ajax.readyState == 4) 

   {

   		 if(ajax.status == 200) 

		{

			divresultado.innerHTML=ajax.responseText;

			

		}

  } 

  else 

  {

  divresultado.innerHTML = '';
  

  }


}