function MM_swapImgRestore() { //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_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.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 MM_findObj(n, d) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.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];}
}



//---------------
var marca='';

function desp(sec)
{

	if(document.getElementById(sec)){

		if(document.getElementById("li1"))document.getElementById("li1").className = "boton"
		if(document.getElementById("li2"))document.getElementById("li2").className = "boton"
		if(document.getElementById("li3"))document.getElementById("li3").className = "boton"
		if(document.getElementById("li4"))document.getElementById("li4").className = "boton"
		if(document.getElementById("li5"))document.getElementById("li5").className = "boton"
		if(document.getElementById("li6"))document.getElementById("li6").className = "boton"
	
		marca = sec
		if(document.getElementById(sec))document.getElementById(sec).className = "bactivo"
	}
}

function changeDiv(dvShow, dvGroup, fromID, hideMeses)  {

	var arrDvs = document.getElementsByTagName("DIV");

	for(i=0;i<arrDvs.length;i++){
		if (arrDvs[i].id.substring(0,dvGroup.length)==dvGroup){
			arrDvs[i].style.visibility="hidden";
			arrDvs[i].style.display="none";
		}
	}
	if (fromID != '') {
		var arrOps = document.getElementsByTagName("A");
		for(i=0;i<arrOps.length;i++){
			if (arrOps[i].id.substring(0,3)=='opc'){
				arrOps[i].className="opcMenuOFF";
			}
		}

	document.getElementById(fromID).className = "opcMenuOFF";
	document.getElementById('opc' + dvShow).className = "opcMenuON";
	}

  document.getElementById(dvGroup+dvShow).style.visibility='visible';
  document.getElementById(dvGroup+dvShow).style.display='block';
  activeDiv = dvShow
  
  if (hideMeses ==null){
  hideMeses = 'Y';
  }
	if(document.getElementById('dvMeses') && hideMeses =='N'){
		document.getElementById('dvMeses').style.visibility='visible';
		document.getElementById('dvMeses').style.display='block';
	}
	if(document.getElementById('dvMeses') && hideMeses =='Y'){
		document.getElementById('dvMeses').style.visibility='hidden';
		document.getElementById('dvMeses').style.display='none';
	}
}

function fotoAnt(){
	var fa = document.getElementById("fotoActual").value
	var tf = document.getElementById("totalFotos").value
	if (fa>1){
		document.getElementById("foto" + fa).style.display = "none"
		document.getElementById("pie" + fa).style.display = "none"
		fa --
		document.getElementById("foto" + fa).style.display = ""
		document.getElementById("pie" + fa).style.display = ""
	}
	document.getElementById("fotoActual").value = fa
}

function fotoSig(){
	var fa = document.getElementById("fotoActual").value
	var tf = document.getElementById("totalFotos").value
	if (fa<tf){
		document.getElementById("foto" + fa).style.display = "none"
		document.getElementById("pie" + fa).style.display = "none"
		fa ++
		
		document.getElementById("foto" + fa).style.display = ""
		document.getElementById("pie" + fa).style.display = ""
	}
	
	document.getElementById("fotoActual").value = fa
}
							
function showDVGrupo(id,grupo){
	
	var arrDvs = document.getElementsByTagName("DIV");

	for(i=0;i<arrDvs.length;i++){
		if (arrDvs[i].id.substring(0,grupo.length)==grupo){
			arrDvs[i].style.display="none";
		}
	}
	obj = document.getElementById(id)
	if(obj){
		if(obj.style.display ==""){
			obj.style.display ="none";
		}
		else{
			obj.style.display ="";
		}
	}
}

function abreMapa(){
	ancho = 450
	alto = 600
	l = (screen.width/2) - (ancho/2)
	t = (screen.height/2) - (alto/2)
	params = "resizable=no,scrollbars=no,width=" + ancho + ",height=" + alto + ",top=" + t + ",left=" + l;
	ventana = window.open("mapaCamaras.aspx",null,params);
}

function abreFichero(file){
	ancho = 250
	alto = 100
	l = (screen.width/2) - (ancho/2)
	t = (screen.height/2) - (alto/2)
	params = "resizable=yes,scrollbars=no,width=" + ancho + ",height=" + alto + ",top=" + t + ",left=" + l;
	ventana = window.open("FileDown.aspx?file="+file,null,params);
}

function addbookmark()
{
	bookmarkurl="http://www.olanoabogados.com"
	bookmarktitle="Olano Abogados"
	if (document.all)
	window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

function popupWin(URL) {

	ancho = 770
	alto = 250
	l = (screen.width/2) - (ancho/2)
	t = (screen.height/2) - (alto/2)
	params = "resizable=yes,scrollbars=yes,width=" + ancho + ",height=" + alto + ",top=" + t + ",left=" + l;
	ventana = window.open(URL,null,params);
}