// JavaScript Document
	Contact = function(){ this.init(); }
	var p = Contact.prototype;
	
	p.req = null;
	p.wait = false;
	p.action = '';
	
	p.init = function(){
		this.req = new Request();
		this.req.listener = this.response.closure(this);
	}
	
	p.contact = function(e){
		var v = '';
		if(e){ StopEvent(e); }
		if(this.wait){ return false; }
		this.wait = true;
		
		v += 'titulo' + SEP_IGUAL + trim($('ctitle').value) + SEP_AND;
		v += 'nombre' + SEP_IGUAL + trim($('cname').value) + SEP_AND;
		v += 'apellido' + SEP_IGUAL + trim($('clname').value) + SEP_AND;
		v += 'email' + SEP_IGUAL + trim($('cemail').value) + SEP_AND;
		v += 'telefono' + SEP_IGUAL + trim($('cphone').value) + SEP_AND;
		v += 'direccion' + SEP_IGUAL + trim($('cadress').value) + SEP_AND;
		v += 'ciudad' + SEP_IGUAL + trim($('ccity').value) + SEP_AND;
		v += 'estado' + SEP_IGUAL + trim($('cstate').value) + SEP_AND;
		v += 'pais' + SEP_IGUAL + trim($('ccountry').value) + SEP_AND;
		v += 'mensaje' + SEP_IGUAL + trim($('cmessage').value) + SEP_AND;
		$('csending').style.display = 'block';
		
		this.action = 'contact';
		this.req.pedir(URL_ROOT + 'request/contact.php', v);
	}
	
	p.response = function(){
		var d = this.req.respuestaXML, e = null;
		this.wait = false;
		$('csending').style.display = 'none';
		
		if(!d){ return alert(this.req.respuestaHTML); }
		else{ 
			e = $('cresponse');
			if(d.getAttribute('tipo') == 'error'){ e.className = ''; }
			else{
				e.className = 'exito';
				
				$('ctitle').value = $('cname').value = $('clname').value = $('cemail').value = 
				$('cphone').value = $('cadress').value = $('ccity').value = $('cstate').value = 
				$('ccountry').value = $('cmessage').value = '';
			}
			e.style.display = 'block';
			e.innerHTML = d.firstChild.data;
		}
	}