function print_mini_calendar(month,year) {
       var url ='/agenda/print_month/'+year+'/'+month+'/';
       new Ajax.Updater('mini_calendar', url, { evalScripts: true,method: 'get'});
}

function search_string(e,elem) {
    ekey = (document.all) ? e.keyCode : e.which;
    if ((ekey==13) || (e.type=='click'))
    {
        if($('form_id').value == ''){

         //  var url ='index.php?action=search&searchstring='+$(elem).value;
           var url ='/agenda/buscar/'+$(elem).value+'/';
              location.href= url;
        }
    }
}


function saveCoutriesPos(){

   var orden="";
   if($('calendars')){
		var items = $('calendars').select('table');
		for (i = 0; i < items.length; i++) {
                    if(items[i].getAttribute('id')){
                        orden = orden + "," +items[i].getAttribute('id');
                    }
		}
      }
  
      new Ajax.Updater('msg', "/agenda_colectividad/includes/calendar_utils.php?action=save_country_pos"+"&orden="+orden,
        {
            onComplete: function() {
               $('msg').update('Posiciones Guardadas Correctamente');
            }
        } );
}

var dialogo = null;
function abrirDialogo(nombre_campo, cat) {

	var w = 480;
	var h = 380;
	var left = (screen.width-w)/2;
	var top = (screen.height-h)/2;

	dialogo = window.open('/admin/file.explorer.php?campo_retorno='+nombre_campo+'&category='+cat,
		'dialogo', 'toolbar=no, location=no, directories=no, status=no, menub ar=no, scrollbar=no, resizable=no, copyhistory=yes,' +
			'width='+w+', height='+h+', left='+left+', top='+top+', screenX='+left+', screenY='+top);
	if(parseInt(navigator.appVersion) >= 4) {
		dialogo.window.focus();
	}
}
