
//******************************************************************************************
	function suscribirse() {
//******************************************************************************************
		var correo = $('txt_correo').value;
		var nombre = $('txt_nombre').value;

		if ((correo.length>0) && (correo != 'Ingrese su Correo') &&  (nombre != 'Ingrese su Nombre')){
			if (checkEmail(correo)) {
				$('txt_correo').value = "";

				var element 	=  	$('Ofertas');
				var parametros	= '';

				var pagina='index_reciba_ofertas.asp?correo=' + correo  + '&nombre=' + nombre  ;

				element.innerHTML = '<img src="images/spinner40.gif">'+'Estamos procesado su subscripcion';

				new Ajax.Updater('Ofertas', pagina, { method: 'post',  asynchronous: true,
							 parameters:parametros, encoding:'UTF-8', evalScripts: true });

				//element.innerHTML = 'Su subscripción ha sido aprobada';
			}
			else {
				alert("Ingrese un Correo Válido");
				$('txt_correo').value = "";
			}
		}
		else {
			alert("Ingrese el Correo y/o Nombre");
			$('txt_correo').focus;
		}
	}

//******************************************************************************************
	function correo_Onchange(obj, opcion){
//******************************************************************************************
		var opcion2	= $('txt_correo').value;

		if (opcion==1){
			if (opcion2 == 'Ingrese su Correo'){
				$('txt_correo').value = '';
			}//end if
		}//end if

		if (opcion==2){
			if (opcion2 == ''){
				$('txt_correo').value = 'Ingrese su Correo';
			}//end if
		}//end if

	}//end function correo_Onchage

//******************************************************************************************
	function nombre_Onchange(obj, opcion){
//******************************************************************************************
		var opcion2	= $('txt_nombre').value;

		if (opcion==1){
			if (opcion2 == 'Ingrese su Nombre'){
				$('txt_nombre').value = '';
			}//end if
		}//end if

		if (opcion==2){
			if (opcion2 == ''){
				$('txt_nombre').value = 'Ingrese su Nombre';
			}//end if
		}//end if

	}//end function nombre_Onchange
//******************************************************************************************
	function checkEmail(address) {
//******************************************************************************************
		//asume valid
		var goodAddress = true;
		//check address
		if (address == "") {goodAddress=false};
		if (address.indexOf ('@') == -1) {goodAddress=false};
		if (address.indexOf ('.') == -1) {goodAddress=false};
		//return true (good address) or false (bad address)
		return goodAddress;
	}
