function getEditorValue(instanceName){  
  var oEditor = FCKeditorAPI.GetInstance(instanceName) ;
  return oEditor.GetXHTML(true).replace(/<[^<]+>|&nbsp;|\n/gi,'');
}

function CheckLen(Target,theForm,len) {
	StrLen = Target.value.length;
	if (StrLen == 1 && Target.value.substring(0,1) == " ") {
		Target.value = "";
		StrLen = 0;
	}if (StrLen > len ) {
		Target.value = Target.value.substring(0,len);
		CharsLeft = 0;
	}else {
		CharsLeft = len - StrLen;
	}
	theForm.faltan.value = CharsLeft;
}

function maxChar(elemento,numero){
	if(elemento.value.length>numero)
		elemento.value=elemento.value.substring(0,numero);
}

function numero(elemento){
	var tmp="";
	for(var i=0;i<elemento.value.length;++i)
		if(elemento.value.charCodeAt(i)>47&&elemento.value.charCodeAt(i)<58)
			tmp=tmp + elemento.value.substring(i,i+1);
		elemento.value=tmp;
}

function valMail(elemento){
	if (elemento.value.match(/^\S{3,}@\S{3,}\.\S{2,}$/)) 
		return true;
	else
		return false;
}

function rangoAno(elemento){
	var fecha = new Date();
	if(elemento.value>=(fecha.getFullYear()-100)&&elemento.value<=fecha.getFullYear()) return true;
	return false;
}
function valFile(selFile,idFile){
	selFile=document.getElementById(selFile);
	idFile=document.getElementById(idFile);
	if (selFile.value=="1")
		idFile.style.display='inline';
	else
		idFile.style.display='none';
}

function validarSQL(theForm){
/*
	var comilla = String.fromCharCode(39)+String.fromCharCode(39);
	for(var i=0; i<theForm.elements.length; i++){
		switch(theForm.elements[i].type){
			case "text":theForm.elements[i].value=theForm.elements[i].value.replace(/'/gi,comilla);break;
			case "textarea":
				theForm.elements[i].value=theForm.elements[i].value.replace(/'/gi,comilla);
				theForm.elements[i].value=theForm.elements[i].value.replace(/(\r\n|\n\r|\n|\r)/gi,"<BR>");
				break;
			case "hidden":
				theForm.elements[i].value=theForm.elements[i].value.replace(/'/gi,comilla);
				theForm.elements[i].value=theForm.elements[i].value.replace(/(\r\n|\n\r|\n|\r)/gi,"<BR>");
				break;
		}
	}
*/
}