var topCenter = 0;
var leftCenter = 0;

function setPosition (nwWidth, nwHeight)
{
var clWidth = screen.width;
var clHeight = screen.height;

topCenter = (clHeight/2)-(nwHeight/2);
leftCenter = (clWidth/2)-(nwWidth/2);
}

function mostrarTarifasRuta (codigoRuta) {

	var winWidth=600;
	var winHeight=400;

	setPosition(winWidth,winHeight);

	var mtURL = "/BQBWeb/servlet/";

	if (gBaseName == "URY")
		mtURL += "com.buquebus.web.consultas.MostrarTarifasUry";
	else if (gBaseName == "ENG")
		mtURL += "com.buquebus.web.consultas.MostrarTarifasEng";	
	else if (gBaseName == "POR")
		mtURL += "com.buquebus.web.consultas.MostrarTarifasPor";	
	else
		mtURL += "com.buquebus.web.consultas.MostrarTarifas";				

	mtURL += "?codRuta="+codigoRuta;

	var newWin = window.open(mtURL,"window","width="+winWidth+", height="+winHeight+", status=No, scrollbars=Yes, resizable=no, menu=no, top="+topCenter+", left="+leftCenter);
	newWin.focus();
}


function mostrarTarifasServicio (codigoViaje, codigoServicio, codigoPromo, codigoPaquete, codigoViajeIda, codigoServicioIda) {

	var winWidth=600;
	var winHeight=400;

	setPosition(winWidth,winHeight);

	var mtURL = "/BQBWeb/servlet/";

	if (gBaseName == "URY")
		mtURL += "com.buquebus.web.consultas.MostrarTarifasUry";
	else if (gBaseName == "ENG")
		mtURL += "com.buquebus.web.consultas.MostrarTarifasEng";	
	else if (gBaseName == "POR")
		mtURL += "com.buquebus.web.consultas.MostrarTarifasPor";	
	else
		mtURL += "com.buquebus.web.consultas.MostrarTarifas";				

	mtURL += "?parViaje="+codigoViaje+"&parServicio="+codigoServicio;

	if (codigoPromo != undefined && codigoPromo != null && codigoPromo != 'NO')
		mtURL += '&parPromo='+codigoPromo;
	if (codigoPaquete != undefined && codigoPaquete != null && codigoPaquete != 'NO')
		mtURL += '&parPaquete='+codigoPaquete;	
	if (codigoViajeIda != undefined)
		mtURL += '&parViajeIda='+codigoViajeIda;
	if (codigoServicioIda != undefined)
		mtURL += '&parServicioIda='+codigoServicioIda;						

	var newWin = window.open(mtURL,"window","width="+winWidth+", height="+winHeight+", status=No, scrollbars=Yes, resizable=no, menu=no, top="+topCenter+", left="+leftCenter);
	newWin.focus();
}


function mostrarPromosViajes (codigoViaje, codigoServicio) {

	var winWidth=760;
	var winHeight=400;

	setPosition(winWidth,winHeight);

	var mtURL = "/BQBWeb/servlet/";

	if (gBaseName == "URY")
		mtURL += "com.buquebus.web.consultas.PromocionesViajes";
	else if (gBaseName == "ENG")
		mtURL += "com.buquebus.web.consultas.PromocionesViajesEng";	
	else if (gBaseName == "POR")
		mtURL += "com.buquebus.web.consultas.PromocionesViajesPor";	
	else
		mtURL += "com.buquebus.web.consultas.PromocionesViajes";				

	mtURL += "?parViaje="+codigoViaje+"&parServicio="+codigoServicio;

	var newWin = window.open(mtURL,"window","width="+winWidth+", height="+winHeight+", status=No, scrollbars=Yes, resizable=no, menu=no, top="+topCenter+", left="+leftCenter);
	newWin.focus();
}


function mostrarDetallesViajes (codigoViaje, codigoServicio) {

	var winWidth = 410;
	var winHeight = 600;

	setPosition(winWidth,winHeight);

	var mtURL = "/BQBWeb/servlet/";

	if (gBaseName == "URY")
		mtURL += "com.buquebus.web.consultas.MostrarDetallesUry";
	else if (gBaseName == "ENG")
		mtURL += "com.buquebus.web.consultas.MostrarDetallesEng";	// no se si sera necesario
	else if (gBaseName == "POR")
		mtURL += "com.buquebus.web.consultas.MostrarDetallesPor";
	else
		mtURL += "com.buquebus.web.consultas.MostrarDetalles";				

	mtURL += "?parViaje="+codigoViaje+"&parServicio="+codigoServicio;

	var newWin = window.open(mtURL,"window","width="+winWidth+", height="+winHeight+", status=No, scrollbars=Yes, resizable=no, menu=no, top="+topCenter+", left="+leftCenter);
	newWin.focus();
}