﻿// JScript File

function ShowHideLayers() { //v3.0
var i,p,v,obj,args=ShowHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=FindObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }
}

function onSubmitOk(boton) 
    { 
    var postBack = new Sys.WebForms.PostBackAction();
    postBack.set_target(boton);
    postBack.set_eventArgument('');
    postBack.performAction();

    }

function AbrirVentana(laURL,nombreVentana,opciones) { 
  winContent = window.open(laURL,nombreVentana,opciones);
  winContent.focus();
}

function CloseWindow()
{
window.close();
}

function FindObj(n, d) { 
  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=FindObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

    var map = null;
    var geocoder = null;

    function showAddress(evento, lugar, direccion, ciudad, pais, fecha, hora) {
      
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(0, 0), 15);
        map.setUIToDefault();
        geocoder = new GClientGeocoder();
      }
      
      if (geocoder) {
        geocoder.getLatLng(
          direccion + ',' + ciudad + ',' + pais,
          function(point) {
            if (!point) {
              //alert(direccion + " no encontrada");
            } else {
              map.setCenter(point, 15);
              var marker = new GMarker(point);
              map.addOverlay(marker);
              marker.openInfoWindowHtml('<b style="font-size:11px">' + evento + '</b><br />'+
              '<span style="font-size:11px">Lugar: ' + lugar + '</span><br />'+
              '<span style="font-size:11px">Dirección: ' + direccion + '</span><br />'+
              '<span style="font-size:11px">Ciudad: ' + ciudad + '</span><br />'
             );
            }
          }
        );
      }
    }