
function abrirJSP(p_proto,p_pag,p_param,p_alto,p_ancho){
	abrirApp(p_proto,p_pag,p_param,p_alto,p_ancho,"AppECOM")
}

function abrirFORM(p_proto,p_pag,p_param,p_alto,p_ancho){
	abrirApp(p_proto,p_pag,p_param,p_alto,p_ancho,"AppForm")
}

function abrirApp(p_proto,p_pag,p_param,p_alto,p_ancho,p_app)
{

 var oRet;
 var iAlto;
 var iAncho;
 var sOptions;
 var p_url;

 if (p_alto==null) iAlto=400;
 else iAlto=p_alto;
 
 if (p_ancho==null) iAncho = 750;
 else iAncho=p_ancho;
 
 sOptions="left=20, top=20, width="+iAncho+",height="+iAlto+",scrollbars=yes,resizable=yes";
 
 p_url = p_proto+"//"+location.host+ "/"+p_app;
 
		
 if (p_param!=null) 
 		p_url = p_url  +p_pag+ "?" +p_param;
 else 
 		p_url = p_url +p_pag;
 
 window.open(p_url, "infor", sOptions);
}

function abrir_pagina(p_proto,p_pag,p_param,p_alto,p_ancho){

 var iAlto;
 var iAncho;
 var sOptions;
 var l_link;

 if (p_alto==null) iAlto=400;
 else iAlto=p_alto;
 
 if (p_ancho==null) iAncho = 750;
 else iAncho=p_ancho;
 
 sOptions="left=20, top=20, width="+iAncho+",height="+iAlto+",scrollbars=yes,resizable=yes";
 
 l_link = p_proto +"//"+ location.host;
 
		
 if ((p_param!=null) && (p_param!=''))
 		l_link = l_link  +p_pag+ "?" +p_param;
 else 
 		l_link = l_link +p_pag; 
 window.open(l_link , 'newWin',sOptions);
 }

function abrirReuters(param){
	var l_linkQ= "http://ri2.rois.com/"+ top.cabecera.JG_rtSesion +"/CTIB/RI3APISNAP?RIC=";
	var l_type="";
	var l_link= l_linkQ + param + l_type;
	window.open(l_link , 'newWin','status=yes,title=yes,width=700,height=500,top=0,left=0,scrollbars=yes,resizable=yes');
}

function abrir_pgvar(pagina,w,h) {
	var l_link = pagina;
	window.open(l_link , 'newWin','status=yes,title=yes,width='+w+',height='+h+',top=0,left=0,scrollbars=no,resizable=no');
}

function abrir_pg(pagina) {
	var l_link = pagina;
	window.open(l_link , 'newWin','status=yes,title=yes,width=500,height=350,top=0,left=0,scrollbars=no,resizable=no');
}

function abrirFondo(mod)
{
 var oRet;
 var iAlto;
 var iAncho;
 var sOptions;
 var url;

 iAlto=540;
 iAncho = 585;
 sOptions="left=20, top=20, width="+iAncho+",height="+iAlto+",scrollbars=no,resizable=yes";
 
 url = path();
 
 if (location.protocol=="https:") {
 	url = url + "/AppECOM/esp/ecom/pc/pweb/jsp/fondos.jsp?namexsl=fondosInversion&indice="+mod+"&tipo=F";
 }
 else {
 		url= url + "/AppECOM/esp/ecom/pc/pweb/jsp/fondos.jsp?namexsl=fondosInversion&indice="+mod+"&tipo=F";
 }
 oRet = window.open(url, "infor", sOptions);
}

function abrirInforme(mod)
{	
		alert(path());
 var p_url;
 p_url = path();
 
 if (location.protocol=="https:") {
 	p_url = p_url + "/AppECOM/esp/ecom/pc/pweb/jsp/bo_semco.jsp?opcion="+mod;
 }
 else {
 	if (location.host.indexOf("172.26.206.44")!=-1)
 		p_url= p_url + "/AppECOM/esp/ecom/pc/pweb/jsp/bo_semco.jsp?opcion="+mod
 	else
 		p_url= p_url + "/AppECOM/fondos.jsp?bo_semco.jsp?opcion="+mod
 }
 rf_ATop.contenido.location = p_url;
}

function abrir_simulador_ABORRAR(pagina,p_ven) {
	var location=path();	
	var l_link = location + "/esp/ecom/pc/pweb/htm/"+pagina;
	if (p_ven==null)
		window.open(l_link , 'newWin','status=yes,title=yes,width=500,height=350,top=0,left=0,scrollbars=no,resizable=no');
	else
		window.open(l_link , 'newWin','status=yes,title=yes,width=500,height=410,top=0,left=0,scrollbars=no,resizable=no');
}

function abrir_gastos(pagina) {
	var url;
	if (location.host.indexOf("172.26.206.44")!=-1)
 		url= "/AppECOM/esp/ecom/pc/pweb/jsp/";
 	else {
 			if (location.protocol=="http:") 
 				url= "/AppECOM/";
 			else
 				url ="/AppECOM/esp/ecom/pc/pweb/jsp/";
 	}
 	
 	url = url + pagina;
	
	window.open(url, 'newWin','status=yes,title=yes,width=550,height=480,top=0,left=0,scrollbars=yes,resizable=no');
}

function abrir_homeComercial(pagina) {
    var l_location="";
    
		var l_link = "https://" + location.host + "/esp/ecom/pc/pweb/htm/homeComercial.htm?acc="+parent.sAcceso+"&pagina="+pagina;
		window.open(l_link,'newWin');

}


function abrir_financiacion(tipoF,obs) 
{
		
        var l_location="";
        
        var l_link = "https://" + location.host + "/esp/ecom/pc/htm/solic_finan.htm?acc=" + parent.sAcceso+"&obs="+obs;
        if (tipoF!=null) l_link+="&tipoF="+tipoF;
		window.open(l_link , 'newWin','status=yes,title=yes,width=800,height=400,top=0,left=0,scrollbars=yes,resizable=yes');
}


function abrir_contacto(param) {
	var descr="";
	if (param!=null) 
	 descr="&descr="+param;

	var l_link = "https://" + location.host + "/esp/ecom/pc/htm/formulario_contacto.htm?origen="+parent.sAcceso+descr;
	
	window.open(l_link , 'newWin','status=yes,title=yes,width=770,height=400,top=0,left=0,scrollbars=yes');
}

function abrir_valores(param) {

	var l_link = "https://" + location.host + "/AppECOM/esp/ecom/pc/jsp/formulario_valores.jsp?param="+param+ "&acc="+parent.sAcceso;
	
	window.open(l_link , 'newWin','status=yes,title=yes,width=770,height=400,top=0,left=0,scrollbars=yes,resizable=yes');
}

function abrir_contacto2(param) {
	var descr="";
	if (param!=null)
	 descr="&descr="+param;
	 
	var l_link = "https://" + location.host + "/AppECOM/esp/ecom/pc/jsp/formulario_contacto.jsp?origen="+parent.sAcceso+descr;
	window.open(l_link , 'newWin','status=yes,title=yes,width=770,height=400,top=0,left=0,scrollbars=yes');
}

function abrir_opinion() {
	var l_location="";

	var l_link = "https://" + location.host + "/esp/ecom/pc/htm/inviform.htm?origen="+parent.sAcceso;
	window.open(l_link , 'newWin','status=yes,title=yes,width=640,height=400,top=0,left=0,scrollbars=yes');
}

function abrir_cuentaonline()
{
        var l_location="";
        var pa=top.sAcceso;

	var l_link="https://" + location.host + "/AppECOM/esp/ecom/pc/jsp/alta_cliente.jsp?entra="+pa+"&cest=01&op=10&imp=null";
	window.open(l_link , 'newWin','status=yes,title=yes,width=770,height=400,top=0,left=0,scrollbars=yes,resizable=yes');
}

function abrir_tarjetas(producto,modalidad,marca,txtTrj) {

	var l_link = "https://" + location.host + "/AppECOM/esp/ecom/pc/pweb/jsp/tarjeta_gen.jsp?acc="+parent.sAcceso+"&producto="+producto+"&modalidad="+modalidad+"&marca="+marca+"&txtTrj=" +escape(txtTrj);
	window.open(l_link , 'newWin','status=yes,title=yes,width=750,height=400,top=0,left=0,scrollbars=yes,resizable=yes');
}


function Abre(tipo,op,imp,plan){
var opcion="";
var Impresora="";
var l_location="";
var pa=top.sAcceso;
opcion=op;
if (opcion==null) opcion=10;

Impresora=imp;
  l_location="https://" + location.host;

if (tipo == 1) {
	
	var l_link = l_location + "/AppECOM/esp/ecom/pc/jsp/alta_cliente.jsp?entra="+pa+ "&cest=01&op=" +opcion+ "&imp=" +Impresora;
	window.open(l_link , 'newWin','status=yes,title=yes,width=770,height=400,top=0,left=0,scrollbars=yes');
}
if (tipo == 2) {
	var l_link = l_location + "/AppECOM/esp/ecom/pc/jsp/alta_cliente.jsp?entra="+pa+"&cest=05&op=" +opcion+ "&imp=" +Impresora;
	window.open(l_link , 'newWin','status=yes,title=yes,width=770,height=400,top=0,left=0,scrollbars=yes');
}
if (tipo == 3) {
	var l_link = l_location + "/AppECOM/esp/ecom/pc/jsp/alta_cliente.jsp?entra="+pa+"&cest=02" + "&op=" +opcion+ "&imp=" +Impresora;
	window.open(l_link , 'newWin','status=yes,title=yes,width=770,height=400,top=0,left=0,scrollbars=yes');
}
if (tipo == 4) {
	
	if (parseInt(opcion,10)!=10){
		alert("Esta opción no puede seleccionarse con 'Renting de ordenadores'");
		return false;
	}
	// var l_link = l_location + "/esp/ecom/pc/htm/formulario_contacto.htm?origen="+parent.sAcceso;
	
	var l_link = l_location + "/AppECOM/esp/ecom/pc/jsp/alta_empresa.jsp?acc="+ pa +"&numElem=0";
	window.open(l_link , 'newWin','status=yes,title=yes,width=750,height=400,top=0,left=0,scrollbars=yes,resizable=yes');
}
if (tipo == 5) {
		
	var l_link = l_location + "/AppECOM/esp/ecom/pc/jsp/alta_tpv.jsp?acc="+ pa +"&numElem=0";
	window.open(l_link , 'newWin','status=yes,title=yes,width=750,height=400,top=0,left=0,scrollbars=yes,resizable=yes');
}

}


function abrir_hipotecas() {
        var l_location="";
        var pa=top.sAcceso;
  l_location="https://" + location.host;

	var l_link = l_location + "/AppECOM/esp/ecom/pc/jsp/sol_hipoteca.jsp?entra="+pa;
	window.open(l_link , 'newWin','status=yes,title=yes,width=750,height=500,hei,top=0,left=0,scrollbars=yes,resizable=yes');
}
