//function to trim leading and trailing white spaces
function trimSpace(str) {
     return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}

function emailValido(str) {
	return (str.indexOf("@") != -1) && (str.indexOf(".") != -1)
}

function randomString(string_length) {
	var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
	var randomstring = '';

	for (var i=0; i<string_length; i++) {
		var rnum = Math.floor(Math.random() * chars.length);
		randomstring += chars.substring(rnum,rnum+1);
	}
	
	return randomstring
}

function openpopupc(popurl, opciones){
	winpops = window.open (popurl, "", opciones)
}

