String.prototype.LTrim = function() { return this.replace(/^s+/g,''); }
String.prototype.RTrim = function() { return this.replace(/s+$/g,''); }
String.prototype.Trim = function() { return this.replace(/^s+|s+$/g,''); }
String.prototype.Left = function(c) { return this.substr(0,c); }
String.prototype.Right = function(c) { return this.substr(this.length-c, this.length); }
String.prototype.isCurrency = function() {
	var patron = /^\d+(\.\d{1,2})?$/;
	if (patron.test(this)) return true;
	return false;
}
String.prototype.isMail = function() {
	var patron = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/
	if(patron.test(this)) return true;
	return false;
}
String.prototype.isDNI = function() {
	var patron = /^\d{8}\D$/;
	if(!patron.test(this)) return false;
	if('TRWAGMYFPDXBNJZSQVHLCKE'.charAt(parseFloat(this.Left(8))%23)!=this.Right(1)) return false;
	return true;
}
String.prototype.isTel = function() {
	var patron = /^[6|9]\d{8}/;
	if(!patron.test(this)) return false;
	return true;
}
Array.prototype.indexOf = function(a) {
	for(var i=0;i<this.length;i++) if(this[i] == a) return a;
	return null;
}

function comprobarExtension(extension, extensiones) {
	for(var i=0;i<extensiones.length;i++) { if(extensiones[i] == extension) return true; }
	return false;
}

function leerError(ex) {
	if(!document.all) alert(ex.message);
	else window.status = ex.message;
}

function checkResponse(response) {
	var ventana = new Window('Error', {
		className: 'alphacube',
		width: 400,
		height: 400,
		title: 'Error'
	});
	ventana.getContent().innerHTML = response.responseText;
	ventana.showCenter();
}