function popup(id)
{
  var ventana=window.open("otras/popimg.asp?idfoto="+id,"pop","status='no',location=0,0, scrollbars=no, resizable=no,width=640,height=480");
  ventana.opener.top.name="opener";
  ventana.focus();
}

function encuesta(idpregunta)
{
  for (i=0;i<document.encuesta.respuesta.length;i++)
  { 
    if (document.encuesta.respuesta[i].checked) 
      break; 
  }
  var respuesta = i+1;   
  var req = new Request({
    url:'ajax.asp',
    method:'post',
   	update: 'refresh-me',
    autoCancel:true,
    data:'idpregunta='+idpregunta+'&respuesta='+respuesta,
    update: 'refresh-me',
    onRequest: function(){
      $('encuesta').addClass('load');
    },
    onSuccess: function(){
      $('encuesta').removeClass('load');
    },
    onFailure: function(){
      alert('Falló la votación');
    },
	onComplete: function(response){
	  $('encuesta').set('html',response);
	}
  }).send(); 
}

function rascacielos()
{
  var res_width = document.documentElement.clientWidth;
  var izq = res_width - 980;
  izq/= 2;
  izq += 980;  
  var rascacielos = document.getElementById("bn_rascacielos").style;
  rascacielos.left = izq+"px";
  rascacielos.visibility = "visible";
}

function calendario(ano,mes)
{
  var req = new Request({
    url:'ajax.asp',
    method:'post',
   	update: 'refresh-me',
    autoCancel:true,
    data:'funcion=calendario&ano='+ano+'&mes='+mes,
    update: 'refresh-me',
    onRequest: function(){
      $('agenda').addClass('load');
    },
    onSuccess: function(){
      $('agenda').removeClass('load');
    },
    onFailure: function(){
      alert('Falló carga calendario');
    },
	onComplete: function(response){
	  $('agenda').set('html',response);
	}
  }).send(); 
}
