$(function(){
 var templates = '\
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja">\
  <head>\
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\
   <meta http-equiv="Content-Language" content="ja" />\
   <meta http-equiv="Content-Style-Type" content="text/css" />\
   <meta http-equiv="Content-Script-Type" content="text/javascript" />\
   <meta http-equiv="Pragma" content="no-cache" />\
   <meta http-equiv="Cache-Control" content="no-cache" />\
   <meta http-equiv="Expires" content="Thu, 01 Dec 1994 16:00:00 GMT" />\
   <link rel="stylesheet" type="text/css" href="../css/system.css" />\
  </head>\
  <body>\
   @@content@@\
  </body>\
 </html>';
 $('div.editorview').each(function(){
  
 }).query('a.evt').click(function(evt){
  window.event.returnValue = false;
  var elm = jslous.Event.target(evt);
  if(elm && elm.tagName && elm.tagName.toLowerCase() == 'a'){
   var req = elm.getAttribute('path');
   jslous.ajax(req,'GET','',function(res){
    if(res.length > 0){
     var trg = document.getElementById('eventdata');
     jslous.func.motion.Listener(trg.style,{
      time:0.3,
      effect:'liner',
      opacity:{from:100,to:0,unit:''},
      comp:function(){
       jslous.css.opacity(trg,0);
       trg.innerHTML = res;
       jslous.func.motion.Listener(trg.style,{
        time:0.3,
        effect:'liner',
        opacity:{from:0,to:100,unit:''},
        comp:function(){
         jslous.css.opacity(trg,100);
        }
       });
      }
     });
     
    }
   },'txt');
  }
 });
});

window.onload = function(){
 setTimeout(function(){
  var anc = location.hash;
  for(var l = 0,alen = document.anchors.length;l < alen;l++){
   if(decodeURIComponent(anc) == '#'+decodeURIComponent(document.anchors[l].name)){
    location.hash = document.anchors[l].name;
   }
  }
 },1000);
}
