function CVSender(stringData) {
	this.data = eval('(' + stringData + ')');
	this.string = stringData;
}

CVSender.prototype.enviar = function() {

	if (this.validar()) {
	
		alert('El CV ha sido enviado con exito.');
		
		var thisObj = this;
		
		new Ajax.Request('saveCV.php?r='+new Date().getTime(), {
			method: 'post',
			parameters: {json: thisObj.string, nombre: thisObj.data.nombre, dni: thisObj.data.dni}
		});
		
	}

};


CVSender.prototype.validar = function() {
	var msg = "";
	
	msg += (this.data.nombre == "")? " - Ingrese el Nombre y Apellido.\n":"";
	msg += (this.data.dni == "")? " - Ingrese el DNI.\n":"";
	msg += (this.data.direccion == "")? " - Ingrese la direccion.\n":"";
	msg += (this.data.celular == "")? " - Ingrese el número de telefono celular.\n":"";
	
	if (msg == "") {
		return true;
	}
	else {
		alert(msg);
		return false;
	}
};
