function openWindow(theURL,winName,myWidth, myHeight, isCenter, scrollbars) { //v3.0
if(window.screen)if(isCenter)if(isCenter=="true"){
	var myLeft = (screen.width-myWidth)/2;
	var myTop = (screen.height-myHeight)/2;
	style= "'toolbar=1,location=0,directories=0,status=1,menubar=1,scrollbars=" + scrollbars + ",resizable=0, width=" + myWidth + ",height=" + myHeight + ",top=" + myTop +",left=" + myLeft + "'";
}
window.open(theURL,winName,style);
}

function textCounter(field, countfield, maxlimit) {
	if (field.value.length > maxlimit) // if too long...trim it!
	field.value = field.value.substring(0, maxlimit);
	// otherwise, update 'characters left' counter
	else 
	countfield.innerHTML = field.value.length;
}

function ltrim(s) {
	return s.replace(/^\s+/, "");
}

function rtrim(s) {
	return s.replace(/\s+$/, "");
}

function trim(s) {
	return rtrim(ltrim(s));
}

function validar(e) { // 1
    tecla = (document.all) ? e.keyCode : e.which; // 2
    if (tecla==8) return true; // 3
    patron =/[A-Za-z\s]/; // 4
    te = String.fromCharCode(tecla); // 5
    return patron.test(te); // 6
} 


function isEmail(string) {
	return (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1);
}


/*onKeyDown="textCounter(this.form.resumenTxt,this.form.resumenLimit,500);" onKeyUp="textCounter(this.form.resumenTxt,this.form.resumenLimit,500);"*/