function getURLPortal(friendlyurl) {
	var portalhost = window.top.location.protocol + "//" + window.top.location.host; // Recupera el host y el puerto
	noauth = "/wps/portal";
	auth = "/wps/myportal";
	toplocation = window.top.location.pathname;
	// Verificamos si el usuario está firmado (/wps/myportal) o no (/wps/portal)
	if(toplocation.indexOf(noauth) == 0) {
		context = noauth;	
	} else if (toplocation.indexOf(auth) == 0) {
		context = auth;
	} else {
		// Esto no deberia pasar dentro del portal, fuera si es posible
		return "";
	}
	finalURL = portalhost + context + friendlyurl;
	return finalURL;
}

function open_win(file, width, height) {
	  var fixedConfig = "menubar=no,location=no,titlebar=yes,toolbar=no,scrollbars=no,resizable=no,status=no";
	  var varConfig = ",height=" + height + ",width=" + width + ",top=50,left=100";
	  var config = fixedConfig + varConfig;
	  window.open(file, "_htmls", config);
}
