//-----------------detector de browser
function lib_bwcheck(){ 
this.ver= parseInt(navigator.appVersion);
var agt=navigator.userAgent.toLowerCase();
this.dom=document.getElementById?1:0
this.ns= ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
&& (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
this.mac=agt.indexOf("Mac")>-1
this.ns4 = (this.ns && (this.ver == 4));
this.ns4up = (this.ns && (this.ver >= 4));
this.ns6up = (this.ns && (this.ver >= 5));
this.ies     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
this.ie4    = (this.ies && (this.ver == 4) && (agt.indexOf("msie 4")!=-1) );
this.ie  = (this.ies  && (this.ver >= 4));
this.ie5    = (this.ies && (this.ver == 4) && (agt.indexOf("msie 5.0")!=-1) );
this.ie5_5  = (this.ies && (this.ver == 4) && (agt.indexOf("msie 5.5") !=-1));
this.ie5up  = (this.ies  && !this.ie3 && !this.ie4);
this.ie5_5up =(this.ies && !this.ie3 && !this.ie4 && !this.ie5);
this.ie6 = (this.ies && (this.ver == 4) && (agt.indexOf("msie 6.")!=-1) );
}
bw=new lib_bwcheck() //Browsercheck object

//-----------------anulación del botón derecho
smsBoton="Botón derecho del ratón deshabilitado. Todas las fotos y dibujos en el presente portal web son copyright de Ambar, otros viajes.";
function clickIE4(){if (event.button==2){alert(smsBoton);return false;}}
function clickNS4(e){
if (e.which==2||e.which==3){alert(smsBoton);return false;}}
if (bw.ns4up){document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS4;}
else if (bw.ie){document.onmousedown=clickIE4;}
document.oncontextmenu=new Function("alert(smsBoton);return false")

//---------------ayuda
function letreros(){
if (bw.ns4){
msd=open('../../../help2.html','Ayuda','width=270,height=255,top=150,left=350')}
else{msd=open('../../../help.html','Ayuda','width=270,height=285,top=150,left=350')}
}

//----------para netscape 4
if(bw.ns4){ 
	scrX= innerWidth; scrY= innerHeight;
	onresize= function(){if(scrX!= innerWidth || scrY!= innerHeight){history.go(0)} }}

//--------------para los tours
	function popUp(winName,fotoName,scroll,menu,centrar,ancho,alto,posy,posx,escribir) {
	try{
if(escribir!=''){
ancho=ancho+5;
alto=alto+5;
}
if(scroll!=''){
lavariable='scrollbars='+scroll}
if(menu!=''){
lavariable+=',menubar='+menu}
if(ancho!=''){
lavariable+=',width='+ancho+'px'}
if(alto!=''){
lavariable+=',height='+alto+'px'}
if(posy!=''){
lavariable+=',top='+posy;}
if(posx!=''){
lavariable+=',left='+posx}

//es obligatorio llamar a las anteriores variables si se quiere llegar a una posterior
//ejemplo:popUp('pagina.html','Titulo','no','no','yes',450,350,'foto')
if(centrar!=''){
      posx = (!bw.ie) ? innerWidth/2-(ancho/2): document.body.clientWidth/2-(ancho/2);
      posy = (!bw.ie) ? innerHeight/2-(alto/2)+75: document.body.clientHeight/2-(alto/2)+60;
lavariable+=',top='+posy+',left='+posx;}

ventana=open(winName,fotoName,lavariable); 
if(escribir!=''){
ancho=ancho-5;
alto=alto-5;
colocarfoto(escribir,fotoName,ancho,alto);
}
}
catch(e){}
}
function colocarfoto(lafoto,fotoName,ancho,alto){
if(bw.ie4){
alert("Es posible que encuentre problemas a la hora de visualizar las fotos con Internet Explorer 4. Le recomendamos actualice su navegador")}
g='<SCRIPT language="Javascript">'+'function NoRaton(e) { if (document.layers && (e.which == 3 || e.which == 2)) {alert("Botón derecho del ratón deshabilitado. Todas las fotos en el presente portal web son copyright de Ambar, otros viajes,  y Kananga, viajes y aventuras.");} else if (event.button == 2 || event.button == 3) {alert("Botón derecho del ratón deshabilitado. Todas las fotos en el presente portal web son copyright de Ambar, otros viajes,  y Kananga, viajes y aventuras.");return false;}}document.onmousedown = NoRaton;</script>'
a='<html><title>'+fotoName+'</title><body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" bgcolor="#000000">'
d='<a href="#" onclick="self.close();return false"><center><img SRC="'+lafoto+'" height="'+alto+'" width="'+ancho+'" border="1" style="border:1px solid white"></center></a>';
e='</body></html>';
ventana.document.write(a+d+g+e);
}


//---------------ayuda
function letreros(){
if (bw.ns4){
msd=open('help2.html','Ayuda','width=270,height=255,top=150,left=350')}
else{msd=open('help.html','Ayuda','width=270,height=285,top=150,left=350')}
}

function cargarimagenes() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=cargarimagenes.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function volver() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}
function vermov() { //v3.0
  var i,j=0,x,a=vermov.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}        			   


function comment(comentario){
window.status=comentario;
}
function uncomment(){
window.defaultStatus="Faro del Sur"
}
if(bw.ie){
window.defaultStatus="Faro del Sur"}

function desplegar(lacapa){
if (document.all[lacapa].style.display=="none"){
document.all[lacapa].style.display="block"
}
else{
document.all[lacapa].style.display="none"
}}

 
 function scrollText(pos) {
  if (bw.ie5up || bw.ns6){
    if (message.charAt(pos) != '^') {
	  txt=txt+message.charAt(pos)
          if (bw.ns6){document.getElementById('letrero').innerHTML=txt}
		  else{  letrero.innerHTML = txt}
      pauze  = scrollSpeed
    }
    else {
      pauze = lineDelay
      txt   = ""
      if (pos == message.length-1) pos = -1
    }
    pos++
	 setTimeout("scrollText('"+pos+"')",pauze)}else
	 {return false}
  }
// Stop hiding from old browsers