<!--
function displayWindow(theURL,winName,width,height,features) { //v3.1
// Made by Eddie Traversa modified from Macromedia Code
// http://nirvana.media3.net/
    var window_width = width;
    var window_height = height;
    var newfeatures= features;
    var window_top = (screen.height-window_height)/2;
    var window_left = (screen.width-window_width)/2;
    newWindow=window.open(''+ theURL + '',''+ winName + '','width=' + window_width + ',height=' + window_height + ',top=' + window_top + ',left=' + window_left + ',features=' + newfeatures + '');
    newWindow.focus();
}

function nuevoAjax()
{
	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 ajx_vaciar(d)
{
	var c;
	c=document.getElementById(d);
	c.innerHTML="";
}

function cargarContenido(url,id_contenedor) {
	var contenedor;
	contenedor = document.getElementById(id_contenedor);
	contenedor.innerHTML ="<i>Cargando datos ...</i>";
	ajax=nuevoAjax();
	if (window.XMLHttpRequest) {
		ajax.onreadystatechange=function() 
		{
			if (ajax.readyState==4) {
				contenedor.innerHTML = ajax.responseText
			}
		}
		ajax.open("GET", url);
		ajax.send(null);
		// branch for IE/Windows ActiveX version
		} else if (window.ActiveXObject) {
			if (ajax) {
			ajax.onreadystatechange=function() 
			{
				if (ajax.readyState==4) {
					contenedor.innerHTML = ajax.responseText
				}
			}
			ajax.open("GET", url, null);
			ajax.send();
		}
	}
}

function formulario_registro()
{
	if (validar_formulario_registro())
	{
		document.frm_conectarse.submit();
	}
}

function validar_formulario_registro()
{
	if (document.frm_conectarse.acepto.checked==false)
	{
		alert("Si no acepta esta casilla no puede continuar con el Registro");
		return false;
	}

	if(document.frm_conectarse.user.value.replace(/ /g, '') == '')
	{
		alert("El campo Nombre de Usuario no puede quedar vacío");
		document.frm_conectarse.user.focus();
		document.frm_conectarse.user.select();
		return false;
	}

	if(document.frm_conectarse.pass.value.replace(/ /g, '') == '')
	{
		alert("El campo Contraseña no puede quedar vacío");
		document.frm_conectarse.pass.focus();
		document.frm_conectarse.pass.select();
		return false;
	}

	if(document.frm_conectarse.pass.value != document.frm_conectarse.pass2.value)
	{
		alert("La confirmación de la Contraseña no coincide");
		document.frm_conectarse.pass2.focus();
		document.frm_conectarse.pass2.select();
		return false;
	}

if(document.frm_conectarse.email.value.replace(/ /g, '') == '')
	{
		alert("El campo EMail no puede quedar vacío");
		document.frm_conectarse.email.focus();
		document.frm_conectarse.email.select();
		return false;
	}

return true;
}


function formulario_oferta()
{
	if (validar_formulario_oferta())
	{
		document.frm_consultaAnunciante.submit();
	}
}

function validar_formulario_oferta()
{
	if(document.frm_consultaAnunciante.PersonaContacto.value.replace(/ /g, '') == '')
	{
		alert("El campo Persona de Contacto no puede quedar vacío");
		document.frm_consultaAnunciante.PersonaContacto.focus();
		document.frm_consultaAnunciante.PersonaContacto.select();
		return false;
	}

	if(document.frm_consultaAnunciante.Empresa.value.replace(/ /g, '') == '')
	{
		alert("El campo Empresa no puede quedar vacío");
		document.frm_consultaAnunciante.Empresa.focus();
		document.frm_consultaAnunciante.Empresa.select();
		return false;
	}

	if(document.frm_consultaAnunciante.Telefono.value.replace(/ /g, '') == '')
	{
		alert("El campo Teléfono no puede quedar vacío");
		document.frm_consultaAnunciante.Telefono.focus();
		document.frm_consultaAnunciante.Telefono.select();
		return false;
	}


return true;
}

//-->
