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 VentanaPopup(nombrevideo, nombrelogo)
{
	var opciones = 'width=347,height=340,toolbar=0,status=0,scrollbars=0,resizable=0,top=250,left=500';
	var ventana = window.open('flvplayer.php?video='+nombrevideo+'&logo='+nombrelogo, 'flvplayer', opciones);
	ventana.focus();
}

function EntrarSexo(activar)
{
	//alert(activar);
	if(activar==1)
	{
		document.getElementById('Layer1').style.visibility = 'hidden';	
	}
}


function SalirSexo()
{
	parent.location.href='http://www.frecuencialatina.com';	
}

//============================================================================
function EntrarSexo_Sesion()
{
	
	var ajaxSendEmail=nuevoAjax();
		ajaxSendEmail.open("POST", "procesar_entrar_sexo.php", true);
		ajaxSendEmail.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		ajaxSendEmail.send();
		//ajax.send(null);
		
		ajaxSendEmail.onreadystatechange=function()
		{
			 //div_contenedor.innerHTML=ajaxSendEmail.responseText;
			if (ajaxSendEmail.readyState==4)
			{
				var patron = /ERROR:/;
				if(ajaxSendEmail.responseText.search(patron)!=-1)
				{
					
				}
				else
				{
					location.href='sexo.php';
				}
			}
		}
}
//**********************************************************************************************************************************

//============================================================================
function SalirSexo_Sesion()
{
	
	var ajaxSendEmail=nuevoAjax();
		ajaxSendEmail.open("POST", "procesar_salir_sexo.php", true);
		ajaxSendEmail.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		ajaxSendEmail.send();
		//ajax.send(null);
		
		ajaxSendEmail.onreadystatechange=function()
		{
			 //div_contenedor.innerHTML=ajaxSendEmail.responseText;
			if (ajaxSendEmail.readyState==4)
			{
				var patron = /ERROR:/;
				if(ajaxSendEmail.responseText.search(patron)!=-1)
				{
					
				}
				else
				{
					parent.location.href='http://www.frecuencialatina.com';
				}
			}
		}
}
//**********************************************************************************************************************************