window.addEvent('domready', function() { 
			var myValidator = new fValidator("frmNov", {language: "es"});
		});


window.addEvent('domready', function() 
{
	////////////////////////////////////////////////////////////////////////
	/* Define los manejadores de eventos para los botones que inician
	   los procedimientos de demostraciÃ³n */
//	$('suscribir').addEvent('click', demoRequest);
	//$('ins_conv').addEvent('click', suscribe);
//	$('frmNov').addEvent('submit', demoRequest);
	$('frmNov').addEvent('submit', function(e) {
		 e.stop();
		 demoRequest();
	});
	////////////////////////////////////////////////////////////////////////
	
});
////////////////////////////////////////////////////////////////////////////
/* http://mootools.net/docs/Request/Request */
function suscribe(n)
{
	/*urlt=$('ins_conv').get('href')+"&date=" + new Date();
	alert(escape(urlt));*/
	var myRequest = new Request({
		//url: $('ins_conv').get('href'),
		url: 'suscribe_conv.asp',
		method: 'post',
		data: $('open_form'+n),
/*		url: urlt,
		method: 'get',
		data: { 'do' : '1' },*/
//		encoding: 'utf-8',
		onRequest: function()
		{
			//alert('Iniciando Request');
		},
		onComplete: function(html)
		{
			//alert('Request terminado ... ' + html);
		},
		onSuccess: function(responseText, responseXML)
		{
			//alert('ExiÃ³osamente!' + responseText);
			//if (responseText!="")
			//{
			//	alert(responseText);
			//}
			/*
				responseText - (string) The returned text from the request.
				responseXML - (mixed) The response XML from the request.
			*/
			// Actualizando manualmente el componente
			$('ins_conv_det'+n).set('html', responseText);
			//var myValidator = new fValidator('ins_consultorio', {language: "es"});
			/*$('enviar').addEvent('click', function(d) {
				alert("hola");
				var myValidator = new fValidator('ins_consultorio', {language: "es"});
				d.stop();
				ReqSuscribe();
			});*/
		},
		onFailure: function(xhr)
		{
			//alert('Fallidamente!');
			alert('Hubo algÃºn error al enviar su peticiÃ³n');
			/*
				xhr - (XMLHttpRequest) The transport instance.
			*/
		},
		onCancel: function()
		{
			alert('Request cancelado!');
		},
		onException: function(headerName, value)
		{
			alert('La cabecera del Request fallÃ³!');
			/*
				headerName - (string) The name of the failing header.
				value - (string) The value of the failing header.
			*/
		}
	}).send();
	/*
		Propiedades:
	
	    myRequest.running - (boolean) True if the request is running.
	    myRequest.response - (object) Object with text and XML as keys. You can access this property in the 'success' event.

	    Métodos:

	    myRequest.setHeader(name, value);
	    myRequest.getHeader(name);
	    myRequest.send([options]);
	    myRequest.cancel();
	*/
}

function ReqSuscribe(m)
{
	var myRequest = new Request({
		url: 'suscribe_conv.asp',
		method: 'post',
		data: $('ins_consultorio'+m),
		onRequest: function()
		{
		},
		onComplete: function(html)
		{
		},
		onSuccess: function(responseText, responseXML)
		{
			//alert(responseText);
			//suscribe();
			$('ins_conv_det'+m).set('html', responseText);
		},
		onFailure: function(xhr)
		{
			alert('Hubo algÃºn error al enviar su peticiÃ³n');
		},
		onCancel: function()
		{
			alert('Request cancelado!');
		},
		onException: function(headerName, value)
		{
			alert('La cabecera del Request fallÃ³!');
		}
	}).send();	
}

////////////////////////////////////////////////////////////////////////////

/* http://mootools.net/docs/Request/Request */
function demoRequest()
{
	var myRequest = new Request({
		url: 'suscribir.asp',
		method: 'post',
		data: $('frmNov'),
		onRequest: function()
		{
			//alert('Iniciando Request');
		},
		onComplete: function(html)
		{
			//alert('Request terminado ... ' + html);
		},
		onSuccess: function(responseText, responseXML)
		{
			//alert('ExiÃ³osamente!' + responseText);
			if (responseText!="")
			{
				alert(responseText);
			}
			/*
				responseText - (string) The returned text from the request.
				responseXML - (mixed) The response XML from the request.
			*/
			// Actualizando manualmente el componente
			//$('componente_3').set('html', responseText);
		},
		onFailure: function(xhr)
		{
			//alert('Fallidamente!');
			alert('Hubo algÃºn error al enviar su peticiÃ³n');
			/*
				xhr - (XMLHttpRequest) The transport instance.
			*/
		},
		onCancel: function()
		{
			alert('Request cancelado!');
		},
		onException: function(headerName, value)
		{
			alert('La cabecera del Request fallÃ³!');
			/*
				headerName - (string) The name of the failing header.
				value - (string) The value of the failing header.
			*/
		}
	}).send();
	/*
		Propiedades:
	
	    myRequest.running - (boolean) True if the request is running.
	    myRequest.response - (object) Object with text and XML as keys. You can access this property in the 'success' event.

	    Métodos:

	    myRequest.setHeader(name, value);
	    myRequest.getHeader(name);
	    myRequest.send([options]);
	    myRequest.cancel();
	*/
}

var newmini2;
function NuevoMini2(mini2,H,W){
newmini2=window.open(mini2,"nuevomini","width="+W+",height="+H+",left=0,top=0,toolbar=no,directories=no,menubar=no,status=no,scrollbars=auto");  
  if (window.focus) {newmini2.focus()}
 // return false;
}