function popup(page,name,prefix,nivel,widthR,heightR){
//La variable "nivel" es exclusivamente para IE6 PC xq mete el path completo
	if(nivel) nivel = (nivel -1);
	backward = "";
	bName = navigator.appName;
	bVer = parseInt(navigator.appVersion);
	bAgent = navigator.userAgent
	ponerlo = false
	
	//alert(bName + " " + bVer)
	if (bName == "Microsoft Internet Explorer"){
		br = "ms";
	} else {
		br = "ns";
	}
	
	//alert("Navegador: " + br + "\nVersión: " + bVer + "\nuserAgent: " + bAgent)
	//alert("Gecko?: " + bAgent.indexOf("Gecko") + "\nMac?: " + bAgent.indexOf("Mac"))
	
	if (br == "ns" ||
		(br == "ms" && bAgent.indexOf("Mac") != -1) ||
		(br == "ms" && bAgent.indexOf("MSIE 6") != -1)){
		ponerlo = true
	}
	if (ponerlo == true){
		if(br == "ms" && bAgent.indexOf("MSIE 6") != -1){
			for(k=0; k <= nivel; k++){
				backward = backward + "../";
				//alert(backward);
			}
		}
		page = backward + prefix + page
	}
//alert("Lo pone?: " + ponerlo + ".\n" + page)
	
/*	if (br == "ns" || bAgent.indexOf("Mac") != -1){
		if ((prefix != '' && br == "ns" &&	bVer < 5) ||
			br == "ms" ||
			(bAgent.indexOf("Gecko") != -1 && !(bAgent.indexOf("Mac") == -1 || bVer < 5))){
			page = prefix + page
		}
	}*/
	
	window.name="Parent"
	
	if (!widthR == ''){
		Ancho = widthR
	} else {
		Ancho = 600
	}
	
	if (!heightR == ''){
		Alto = heightR
	} else {
		Alto = 400
	}
	
	if (widthR == 'fullpg'){
		Ancho = screen.width
	}
	if (heightR == 'fullpg'){
		Alto = screen.height
	}
	
	DistArriba = ((screen.height / 2) - Math.round(Alto / 2))
	DistIzq = ((screen.width / 2) - Math.round(Ancho / 2))
	// alert(DistArriba)
	// alert(DistIzq)
	params = "toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1"
	params = params + ",width="+Ancho +",height="+ Alto
	params = params + ",top=" + DistArriba + ",left=" + DistIzq + ", screenY=" + DistArriba + ", screenX=" + DistIzq
		popwindow = open(page,name,params);
		popwindow.focus();

	return false;
}


function urlbk(pre,post){
	bName = navigator.appName;
	bVer = parseInt(navigator.appVersion);
	bAgent = navigator.userAgent
	ponerlo = false
	
	//alert(bName + " " + bVer)
	if (bName == "Microsoft Internet Explorer"){
		br = "ms";
	} else {
		br = "ns";
	}
	
	if (br == "ns" ||
		(br == "ms" && bAgent.indexOf("Mac") != -1)){
		ponerlo = true
	}
	if (ponerlo == true){
		urlbk = pre + post
	} else {
		urlbk = post
	}
	//alert('URL de destino: ' + urlbk)
	return urlbk
	//alert("Navegador: " + br + "\nVersión: " + bVer + "\nuserAgent: " + bAgent)
}

//Esta función permite variar la posición de la capa puntero de los mapas si es vista por IE6
function placeIt(capa,distop){//Ya no se usa--> Flash
	bAgent = navigator.userAgent
	if(bAgent.indexOf("MSIE 6") != -1){
		capaPuntero = document.getElementById(capa);
		capaPuntero.style.top = distop-5;
	}
}

function centerLayer(how, lySize){
    if(how=="ancho"){
        document.write (screen.width/2) - Math.round(lySize/2);
    }
    if(how=="alto"){
        document.write (screen.height/2) - Math.round(lySize/2);
    }
}
