// Codi de Carles Reverter - Freelance - Disseny i produccio web
// http://www.carlesrever.com - mail@carlesrever.com
// rutines js per DHTML. Si les fas servir, respecta aquestes tres linies

var ns4=false; var ie4=false; var standard=false

//Arreglo para textos generales
var AATexto = new Array (new Array (6),new Array (6))

//--Castellano
AATexto[0][0] = "Reservas On-line Royal Caribbean y Celebrity Cruises"
AATexto[1][0] = "Acceso Inválido"

//--Portugues
AATexto[0][1] = "Reservas On-line Royal Caribbean y Celebrity Cruises"
AATexto[1][1] = "Invalid Access"

//--Ingles
AATexto[0][2] = "On-line Royal Caribbean & Celebrity Cruises booking"
AATexto[1][2] = "Invalid Access"

//--Francés
AATexto[0][3] = "Réservations On-line Royal Caribbean et Celebrity Cruises"
AATexto[1][3] = "Invalid Access"

//--Italiano
AATexto[0][4] = "Opzione on line Royal Caribbean"
AATexto[1][4] = "Invalid Access"

//--Aleman
AATexto[0][5] = "Reservas On-line Royal Caribbean y Celebrity Cruises"
AATexto[1][5] = "Invalid Access"


if (document.getElementById) {
    standard=true
} else if (document.all) {
	ie4=true
} else if (document.layers) {
    ns4=true
} else {
}

if (navigator.userAgent.indexOf("Mac",0) != -1) {
	var mac=true
} else {
	var mac=false
}

var carregat=false;
function inic() {carregat=true}
if (ns4) {carregat=true}

function popup (tamanyX, tamanyY, adre, nom, posX, posY, attr) {
				var x=(screen.width-tamanyX) * posX / 100;
                var y=(screen.height-tamanyY) * posY / 100;
                if (attr=="") {attr='resizable=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0'}

                finestra=open(adre,nom,attr+',width='+tamanyX+',height='+tamanyY+',left='+x+',top='+y+',screenX='+x+',screenY='+y+'');
                if (mac && !netscape) {finestra.moveTo(x,y)}
}

function preLoad(objecte,arxiu) {
	for (var i=0; i<preLoad.arguments.length; i=i+2) {
		eval(preLoad.arguments[i] + "= new Image()")
		isrc=preLoad.arguments[i+1]
		eval(preLoad.arguments[i] + ".src = '"+isrc+"'")
	}
} 

function canviaImatge (nomCapa,nomImatge,arxiu){
if (ns4) {
	if (nomCapa != "") {
    eval("document.layers."+nomCapa+".document.images['"+nomImatge+"'].src="+arxiu);
	} else {
    eval("document.images['"+nomImatge+"'].src="+arxiu);
	}
}
if (ie4) {
 	eval("document.images['"+nomImatge+"'].src="+arxiu);
}
if (standard) {
 	eval("document.images['"+nomImatge+"'].src="+arxiu);
}
}

function vistaCapa(nomCapa,accio) {
if (ns4) {
   document.layers[nomCapa].visibility = accio;
}
if (ie4) {
   document.all[nomCapa].style.visibility = accio;
}
if (standard) {
   document.getElementById(nomCapa).style.visibility = accio;
}
}

function inicbarra(nomgrup,numopcions,urlcom,urllow,urlhi,activa) {
	for (var n=1; n<=numopcions; n++) {
		preLoad(nomgrup + n + "l", urlcom + n + urllow, nomgrup + n + "h", urlcom + n + urlhi)
	}
	eval("clica_"+nomgrup+"=activa")
}

function over(capa,nomgrup,n) {
if (carregat) {
	eval('canviaImatge(capa,"'+nomgrup+n+'","'+nomgrup+n+'h.src")');
}
}

function out(capa,nomgrup,n) {
if (carregat) {
	eval("act=clica_"+nomgrup)
	if (act!=n) {
		eval('canviaImatge(capa,"'+nomgrup+n+'","'+nomgrup+n+'l.src")');
	}
}
}

function clica(capa,nomgrup,n) {
	eval("act=clica_"+nomgrup)
	eval('canviaImatge(capa,"'+nomgrup+n+'","'+nomgrup+n+'h.src")');
	eval("clica_"+nomgrup+"=n")
	if (act != 0) {out(capa,nomgrup,act)}
	if (capa=="Lselector") {
		canviaImatge ("Lmapa","miniatura","'../barcos/mapas/minuiatura/" + barcos[n-1]+"'")
		canviaImatge ("Lzoom","ampliacio","'../barcos/mapas/ampliacion/" + barcos[n-1]+"'")
	}
}

function resizeNS4() {
	if (ns4) {location.reload()}
}

function mouCapa(nomCapa, x, y) {
if (ns4) {
                document.layers[nomCapa].left=x;
                document.layers[nomCapa].top=y;
}
if (ie4) {
		        document.all[nomCapa].style.left=x;  
                document.all[nomCapa].style.top=y;
}
if (standard) {
		        document.getElementById(nomCapa).style.left=x;  
                document.getElementById(nomCapa).style.top=y;
}
}