jslous.noConflict();
var js = jslous;
js(function(){
 var url = 'http://'+location.host+'/contents/press_room/topics.php';
 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="system.css" />\
   <script type="text/javascript">\
   window.onload = setTimeout(function(){\
	if(window.parent){\
     var trg = window.document.body;\
	 var height = navigator.userAgent.indexOf(\'AppleWebKit/\') > -1 ? document.height:trg.scrollHeight;\
     var iframe = window.parent.document.getElementById("innerframe");\
	 iframe.style.height = height+"px";\
	}\
   },500);\
   </script>\
  </head>\
  <body>\
   <table width="625">\
    <tr>\
     <td>\
   @@content@@\
     </td>\
    </tr>\
   <table>\
  </body>\
 </html>';
 
 $('div#topics_insert').each(function(){
  var elm = this;
  if(elm && elm.tagName && elm.tagName.toLowerCase() == 'div'){
   var target = document.getElementById('article').value;
   var $key = '?unique='+target+'&mode=put';
   jslous.ajax(url+$key,'GET','',function(res){
    var frame = document.createElement('iframe');
    frame['id'] = 'innerframe';
    frame.scrolling = 'no';
    if(jslous.Agents.ie){ frame.frameBorder = 0; }
    elm.innerHTML = '';
    elm.appendChild(frame);
    frame['className'] = 'editorview';
    frame.contentWindow.document.open();      
    var temp = document.createElement('div');
    temp.innerHTML = res;
    var links = jslous.node.list2array(temp.getElementsByTagName('a'));
    for(var i = 0,len = links.length;i < len;i++){
     if(!links[i].target || links[i].target != '_blank'){ links[i].target = '_parent'; }
    }
    var html = templates.replace('@@content@@',temp.innerHTML);
    frame.contentWindow.document.write(html);
    frame.contentWindow.document.close();   
    elm.style['display'] = '';
    elm.setAttribute('flg',0);
   },'txt');
  }
 });
});
