function checkFormCont()
{
	with (window.document.frmCont) {
		if (nombre.value == '') {
			alert('Introducir Nombre');
			return;
		} else if (email.value == '') {
			alert('Introducir E-mail');
			return;
		} else if (cont.value == '') {
			alert('Introducir el contenido');
			return;
		} else {
			sendForm(nombre.value,email.value,cont.value);
		}
	}
}

function sendForm(nombre,email,cont) {


    var xhr = getTransport_form();
    xhr.onreadystatechange = function() {
        updateChange_form(xhr);
    }

	xhr.open('post', 'datasource/form.php', true);
	xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
    xhr.send('nombre='+nombre+'&email='+email+'&cont='+cont);
 
}

             
function getTransport_form() {
	if (window.XMLHttpRequest) {
		return new XMLHttpRequest();
    } else if (window.ActiveXObject) {
        try {
        	return new ActiveXObject('Msxml2.XMLHTTP');
            } catch(e) {
            return new ActiveXObject('Microsoft.XMLHTTP');
    	}
    }
}

function updateContent_form(html) {
                var content = document.getElementById('frm_cont');
                content.innerHTML = html;
                
                while (html.match(/(<script[^>]+javascript[^>]+>\s*(\/\/*<!\[CDATA\[)?(<!--)?\s*)/i)) {
                    html = html.substr(html.indexOf(RegExp.$1) + RegExp.$1.length);
                    if (!html.match(/((\/\/ *\]\]>)?(-->)?\s*<\/script>)/)) break;
                    block = html.substr(0, html.indexOf(RegExp.$1));
                    html = html.substring(block.length + RegExp.$1.length);
                    eval(block);
                }
}
            
function updateChange_form(xhr) {	
    if (xhr.readyState != 4) {
		document.getElementById('frm_cont').innerHTML='<div align="center"><img src="../../imagenes/ajax-loader.gif" width="220" height="19" /></div>';
	}else{
        if (xhr.status == 200) {
            updateContent_form(xhr.responseText);           
        } else {
            //alert('Error: ' + xhr.status + '!');
        }
    }
}