jslous.noConflict();

/* Main */
//var root_path = '../../'+'';
/* /Main */

/* Debug */
var root_path = 'http://'+location.host+'/'+'';
/* /Debug */

var req_path = root_path+'req/';
var js = jslous;
js(function(){
 js('div#right_body').each(function(){
  var elm = this;
  elm.style['display'] = 'none';
  var paths = location.pathname.split('/');
  paths.pop();
  paths = paths.join('/')+'/';
  if(elm && elm.tagName && elm.tagName.toLowerCase() == 'div'){
   jslous.ajax(req_path+'calender.php'+(paths == '/event/mail/' ? '?parent=1':''),'GET','',function(res){
    elm.innerHTML = res;
    elm.style['display'] = 'block';
   },'txt');
  }
 }).query('select#dates').change(function(evt){
  var elm = jslous.Event.target(evt);
  if(elm && elm.tagName && elm.tagName.toLowerCase() == 'select'){
   var v = jslous.node.getSelect(elm).value;
   var replace = document.getElementById('evt');
   if(!replace){
    return false;
   }
   jslous.ajax(req_path+'evt.php?dates='+v,'GET','',function(res){
    box = [];
    js('evt',res).each(function(){
     var self = this,value = self.getAttribute('data'),text = self.getAttribute('label');
     box.push({val:value,txt:text});
    });
    box = jslous.node.createSelect(box);
    box['name'] = replace['name'];
    replace.parentNode.replaceChild(box,replace);
    box['id'] = 'evt';
   },'xml');
  }
 });
 
});