var js_bt3_obj;
var js_bt4_obj = "Hello Maskat!";
var js_bt6_obj = "Hello Maskat!";
var js_bt8_obj;

/* ラベル */
function lb_text_init(){
lb_lb5.setText('');
//lb_tx1.setStyle({fontSize:"0.8em"});
//lb_tx2.setStyle({fontSize:"0.8em"});
//lb_tx3.setStyle({fontSize:"0.8em"});
//lb_tx4.setStyle({fontSize:"0.8em"});
lb_tx1.setValue('');
lb_tx2.setValue('');
lb_tx3.setValue('<label name="lb_lb3" text="Hello Maskat!" />\n<label name="lb_lb5" text="" />');
lb_tx4.setValue('<param rootNode="maskat">\n  <source obj="lb_lb3" node="label"/>\n</param>\n<result rootNode="maskat">\n  <target out="lb_lb5" in="label"/>\n</result>');
}
lb_text_init();
lb_bt2.onclick = function(){
  lb_text_init();
}

function lb_bt1_before(param){
  lb_tx1.setValue(param.sendXML);
}

function lb_bt1_after(param){
  lb_tx2.setValue(param.xhr.responseText);
}

/* テキストボックス */
function tx_text_init(){
/*tx_tx3.setStyle({fontSize:"0.8em"});
tx_tx4.setStyle({fontSize:"0.8em"});
tx_tx5.setStyle({fontSize:"0.8em"});
tx_tx6.setStyle({fontSize:"0.8em"});*/
tx_tx1.setValue('Hello Maskat!');
tx_tx2.setValue('');
tx_tx3.setValue('');
tx_tx4.setValue('');
tx_tx5.setValue('<text name="tx_tx1" />\n<text name="tx_tx2" />');
tx_tx6.setValue('<param rootNode="maskat">\n  <source obj="tx_tx1" node="text"/>\n</param>\n<result rootNode="maskat">\n  <target out="tx_tx2" in="text"/>\n</result>');
}
tx_text_init();
tx_bt2.onclick = function(){
  tx_text_init();
}

function tx_bt1_before(param){
  tx_tx3.setValue(param.sendXML);
}

function tx_bt1_after(param){
  tx_tx4.setValue(param.xhr.responseText);
}

/* コンボボックス */
function cm_text_init(){
/*cm_tx3.setStyle({fontSize:"0.8em"});
cm_tx4.setStyle({fontSize:"0.8em"});
cm_tx5.setStyle({fontSize:"0.8em"});
cm_tx6.setStyle({fontSize:"0.8em"});*/
cm_cm1.selWithValue('cm_cm1_ci1');
cm_cm2.selWithValue('cm_cm2_ci1');
cm_tx3.setValue('');
cm_tx4.setValue('');
cm_tx5.setValue('<combo name="cm_cm1">\n  <comboItem text="コンボボックスアイテム1" value="cm_cm1_ci1" />\n  <comboItem text="コンボボックスアイテム2" value="cm_cm1_ci2" />\n  <comboItem text="コンボボックスアイテム3" value="cm_cm1_ci3" />\n  <comboItem text="コンボボックスアイテム4" value="cm_cm1_ci4" />\n</combo>\n<combo name="cm_cm2">\n  <comboItem text="コンボボックスアイテム1" value="cm_cm2_ci1" />\n  <comboItem text="コンボボックスアイテム2" value="cm_cm2_ci2" />\n  <comboItem text="コンボボックスアイテム3" value="cm_cm2_ci3" />\n  <comboItem text="コンボボックスアイテム4" value="cm_cm2_ci4" />\n</combo>');
cm_tx6.setValue('<param rootNode="maskat">\n  <source obj="cm_cm1" node="value"/>\n</param>\n<result rootNode="maskat">\n  <target out="cm_cm2" in="value"/>\n</result>');
}
cm_text_init();
cm_bt2.onclick = function(){
  cm_text_init();
}

function cm_bt1_before(param){
  cm_tx3.setValue(param.sendXML);
}

function cm_bt1_after(param){
  cm_tx4.setValue(param.xhr.responseText);
}

/* チェックボックス */
function ch_text_init(){
/*ch_tx3.setStyle({fontSize:"0.8em"});
ch_tx4.setStyle({fontSize:"0.8em"});
ch_tx5.setStyle({fontSize:"0.8em"});
ch_tx6.setStyle({fontSize:"0.8em"});*/
ch_ch1.setCheck(false);
ch_ch2.setCheck(false);
ch_tx3.setValue('');
ch_tx4.setValue('');
ch_tx5.setValue('<checkbox name="ch_ch1" text="チェックボックス" />\n<checkbox name="ch_ch2" text="チェックボックス" />');
ch_tx6.setValue('<param rootNode="root">\n  <source obj="ch_ch1" node="check"/>\n</param>\n<result rootNode="maskat">\n  <target out="ch_ch2" in="check"/>\n</result>');
}
ch_text_init();
ch_bt2.onclick = function(){
  ch_text_init();
}

function ch_bt1_before(param){
  ch_tx3.setValue(param.sendXML);
}

function ch_bt1_after(param){
  ch_tx4.setValue(param.xhr.responseText);
}

/* ラジオボタン(未実装) */
function rd_text_init(){
/*rd_tx1.setStyle({fontSize:"0.8em"});
rd_tx2.setStyle({fontSize:"0.8em"});
rd_tx3.setStyle({fontSize:"0.8em"});
rd_tx4.setStyle({fontSize:"0.8em"});*/
rd_tx1.setValue('');
rd_tx2.setValue('');
rd_tx3.setValue('<radio name="rd_rd1" top="70" left="30" text="ラジオボタン1" checked="true"/>\n<radio name="rd_rd2" top="90" left="30" text="ラジオボタン2" />');
rd_tx4.setValue('<param rootNode="maskat">\n  <source obj="rd_rd_g1" node="check"/>\n    </param>\n  <result rootNode="maskat">\n    <target out="rd_rd_g2" in="check"/>\n  </result>');
}
rd_text_init();
rd_bt2.onclick = function(){
  rd_text_init();
}

function rd_bt1_before(param){
  rd_tx1.setValue(param.sendXML);
}

function rd_bt1_after(param){
  rd_tx2.setValue(param.xhr.responseText);
}

/* 表:受信 */
function gr1_text_init(){
/*gr1_tx1.setStyle({fontSize:"0.8em"});
gr1_tx2.setStyle({fontSize:"0.8em"});
gr1_tx3.setStyle({fontSize:"0.8em"});*/
gr1_gr1.initTab();
if (gr1_gr1 && gr1_gr1.oldColCLic){
  gr1_gr1.oldColCLic.boolOrder = true; // ソート順が昇順降順入れ替わるのを阻止
}
gr1_tx1.setValue('');
gr1_tx2.setValue('<grid name="gr1_gr1" multiSelect="false">\n  <gridHeader title="ヘッダ1" />\n  <gridHeader title="ヘッダ2" />\n  <gridHeader title="ヘッダ3" />\n</grid>');
gr1_tx3.setValue('<result rootNode="maskat">\n  <target out="gr1_gr1" in="rows" inkey="row">\n    <bind tokey="0" node="col1"/>\n    <bind tokey="1" node="col2"/>\n    <bind tokey="2" node="col3"/>\n  </target>\n</result>');
}
gr1_text_init();
gr1_bt2.onclick = function(){
  gr1_text_init();
}

function gr1_bt1_after(param){
  gr1_tx1.setValue(param.xhr.responseText);
}

/* 表:全送信 */
function gr2_text_init(){
/*gr2_tx1.setStyle({fontSize:"0.8em"});
gr2_tx2.setStyle({fontSize:"0.8em"});
gr2_tx3.setStyle({fontSize:"0.8em"});*/
gr2_tx1.setValue('');
gr2_tx2.setValue('<grid name="gr2_gr1" multiSelect="false">\n  <gridHeader title="ヘッダ1" />\n  <gridHeader title="ヘッダ2" />\n  <gridHeader title="ヘッダ3" />\n  <gridLine>\n    <gridCell value="セル1_1" />\n    <gridCell value="セル1_2" />\n    <gridCell value="セル1_3" />\n  </gridLine>\n  <gridLine>\n    <gridCell value="セル2_1" />\n    <gridCell value="セル2_2" />\n    <gridCell value="セル2_3" />\n  </gridLine>\n  <gridLine>\n    <gridCell value="セル3_1" />\n    <gridCell value="セル3_2" />\n    <gridCell value="セル3_3" />\n  </gridLine>\n  <gridLine>\n    <gridCell value="セル4_1" />\n    <gridCell value="セル4_2" />\n    <gridCell value="セル4_3" />\n  </gridLine>\n</grid>');
gr2_tx3.setValue('<param rootNode="maskat">\n  <source obj="gr2_gr1" node="rows" childNode="row">\n    <bind fromkey="0" node="col1"/>\n    <bind fromkey="1" node="col2"/>\n    <bind fromkey="2" node="col3"/>\n  </source>\n</param>');
}
gr2_text_init();
gr2_bt2.onclick = function(){
  gr2_text_init();
}

function gr2_bt1_before(param){
  gr2_tx1.setValue(param.sendXML);
}

/* 表:選択行(1行)送信 */
function gr3_text_init(){
/*gr3_tx1.setStyle({fontSize:"0.8em"});
gr3_tx2.setStyle({fontSize:"0.8em"});
gr3_tx3.setStyle({fontSize:"0.8em"});*/
gr3_tx1.setValue('');
gr3_tx2.setValue('<grid name="gr3_gr1" multiSelect="false">\n  <gridHeader title="ヘッダ1" />\n  <gridHeader title="ヘッダ2" />\n  <gridHeader title="ヘッダ3" />\n  <gridLine>\n    <gridCell value="セル1_1" />\n    <gridCell value="セル1_2" />\n    <gridCell value="セル1_3" />\n  </gridLine>\n  <gridLine>\n    <gridCell value="セル2_1" />\n    <gridCell value="セル2_2" />\n    <gridCell value="セル2_3" />\n  </gridLine>\n  <gridLine>\n    <gridCell value="セル3_1" />\n    <gridCell value="セル3_2" />\n    <gridCell value="セル3_3" />\n  </gridLine>\n  <gridLine>\n    <gridCell value="セル4_1" />\n    <gridCell value="セル4_2" />\n    <gridCell value="セル4_3" />\n  </gridLine>\n</grid>');
gr3_tx3.setValue('<param rootNode="maskat">\n  <source obj="gr3_gr1" node="val" idxRef="gr3_gr1">\n    <bind fromkey="0" node="col1"/>\n    <bind fromkey="1" node="col2"/>\n    <bind fromkey="2" node="col3"/>\n  </source>\n</param>');
}
gr3_text_init();
gr3_bt2.onclick = function(){
  gr3_text_init();
}

function gr3_bt1_before(param){
  gr3_tx1.setValue(param.sendXML);
}

/* 表:選択行(1行)送信(idxRef版) */
function gr4_text_init(){
/*gr4_tx1.setStyle({fontSize:"0.8em"});
gr4_tx2.setStyle({fontSize:"0.8em"});
gr4_tx3.setStyle({fontSize:"0.8em"});*/
gr4_tx1.setValue('');
gr4_tx2.setValue('<grid name="gr4_gr1" multiSelect="false">\n  <gridHeader title="ヘッダ1" />\n  <gridHeader title="ヘッダ2" />\n  <gridHeader title="ヘッダ3" />\n  <gridLine>\n    <gridCell value="セル1_1" />\n    <gridCell value="セル1_2" />\n    <gridCell value="セル1_3" />\n  </gridLine>\n  <gridLine>\n    <gridCell value="セル2_1" />\n    <gridCell value="セル2_2" />\n    <gridCell value="セル2_3" />\n  </gridLine>\n  <gridLine>\n    <gridCell value="セル3_1" />\n    <gridCell value="セル3_2" />\n    <gridCell value="セル3_3" />\n  </gridLine>\n  <gridLine>\n    <gridCell value="セル4_1" />\n    <gridCell value="セル4_2" />\n    <gridCell value="セル4_3" />\n  </gridLine>\n</grid>');
gr4_tx3.setValue('<param rootNode="maskat">\n  <source obj="gr4_gr1" node="val" idxRef="gr4_idxRefObj">\n    <bind fromkey="0" node="col1"/>\n    <bind fromkey="1" node="col2"/>\n    <bind fromkey="2" node="col3"/>\n  </source>\n</param>');
}
gr4_text_init();
gr4_bt1.onclick = function(){
  var str = "";
  for (var i = 0; i < gr4_idxRefObj.length; i++){
    for (var j = 0; j < gr4_idxRefObj[i].length; j++){
      str += "[" + gr4_idxRefObj[i][j] + "]";
    }
    str += "\n";
  }
  alert(str);
}
gr4_bt3.onclick = function(){
  gr4_text_init();
}

function gr4_bt2_before(param){
  gr4_tx1.setValue(param.sendXML);
}

var gr4_idxRefObj = new Array(4);
for (var i = 0; i < gr4_idxRefObj.length; i++){
  gr4_idxRefObj[i] = new Array(3);
  for (var j = 0; j < gr4_idxRefObj[i].length; j++){
    gr4_idxRefObj[i][j] = (i + 1) + "-" + (j + 1);
  }
}

/* 表:選択行(複数行)送信 */
function gr5_text_init(){
/*gr5_tx1.setStyle({fontSize:"0.8em"});
gr5_tx2.setStyle({fontSize:"0.8em"});
gr5_tx3.setStyle({fontSize:"0.8em"});*/
gr5_tx1.setValue('');
gr5_tx2.setValue('<grid name="gr5_gr1" top="70" left="30" height="250" rang="10" lineHeight="16" multiSelect="true" >\n <gridHeader title="ヘッダ1" type="string" width="70" />\n <gridHeader title="ヘッダ2" type="string" width="70" />\n <gridHeader title="ヘッダ3" type="string" width="70" />\n <gridLine>\n  <gridCell value="セル1_1" />\n  <gridCell value="セル1_2" />\n  <gridCell value="セル1_3" />\n </gridLine>\n <gridLine>\n  <gridCell value="セル2_1" />\n  <gridCell value="セル2_2" />\n  <gridCell value="セル2_3" />\n </gridLine>\n <gridLine>\n  <gridCell value="セル3_1" />\n  <gridCell value="セル3_2" />\n  <gridCell value="セル3_3" />\n </gridLine>\n <gridLine>\n  <gridCell value="セル4_1" />\n  <gridCell value="セル4_2" />\n  <gridCell value="セル4_3" />\n </gridLine>\n</grid>');
gr5_tx3.setValue('<param rootNode="maskat">\n  <source obj="gr5_gr1" idxRef="gr5_gr1" node="rows" childNode="row">\n    <bind fromkey="0" node="col1"/>\n    <bind fromkey="1" node="col2"/>\n    <bind fromkey="2" node="col3"/>\n  </source>\n</param>');
}
gr5_text_init();
gr5_bt2.onclick = function(){
  gr5_text_init();
}

function gr5_bt1_before(param){
  gr5_tx1.setValue(param.sendXML);
}

/* 表:選択行(複数行)送信(idxRef版) */
function gr6_text_init(){
/*gr6_tx1.setStyle({fontSize:"0.8em"});
gr6_tx2.setStyle({fontSize:"0.8em"});
gr6_tx3.setStyle({fontSize:"0.8em"});*/
gr6_tx1.setValue('');
gr6_tx2.setValue('<grid name="gr6_gr1" top="70" left="30" height="250" rang="10" lineHeight="16" multiSelect="true" >\n <gridHeader title="ヘッダ1" type="string" width="70" />\n <gridHeader title="ヘッダ2" type="string" width="70" />\n <gridHeader title="ヘッダ3" type="string" width="70" />\n <gridLine>\n  <gridCell value="セル1_1" />\n  <gridCell value="セル1_2" />\n  <gridCell value="セル1_3" />\n </gridLine>\n <gridLine>\n  <gridCell value="セル2_1" />\n  <gridCell value="セル2_2" />\n  <gridCell value="セル2_3" />\n </gridLine>\n <gridLine>\n  <gridCell value="セル3_1" />\n  <gridCell value="セル3_2" />\n  <gridCell value="セル3_3" />\n </gridLine>\n <gridLine>\n  <gridCell value="セル4_1" />\n  <gridCell value="セル4_2" />\n  <gridCell value="セル4_3" />\n </gridLine>\n</grid>');
gr6_tx3.setValue('<param rootNode="maskat">\n  <source obj="gr6_gr1" idxRef="gr6_idxRefObj" node="rows" childNode="row">\n    <bind fromkey="0" node="col1"/>\n    <bind fromkey="1" node="col2"/>\n    <bind fromkey="2" node="col3"/>\n  </source>\n</param>');
}
gr6_text_init();
gr6_bt3.onclick = function(){
  gr6_text_init();
}
gr6_bt1.onclick = function(){
  var str = "";
  for (var i = 0; i < gr6_idxRefObj.length; i++){
    for (var j = 0; j < gr6_idxRefObj[i].length; j++){
      str += "[" + gr6_idxRefObj[i][j] + "]";
    }
    str += "\n";
  }
  alert(str);
}

function gr6_bt2_before(param){
  gr6_tx1.setValue(param.sendXML);
}

var gr6_idxRefObj = new Array(4);
for (var i = 0; i < gr6_idxRefObj.length; i++){
  gr6_idxRefObj[i] = new Array(3);
  for (var j = 0; j < gr6_idxRefObj[i].length; j++){
    gr6_idxRefObj[i][j] = (i + 1) + "-" + (j + 1);
  }
}

/* 選択セル送信1 */
function gr7_text_init(){
/*gr7_tx1.setStyle({fontSize:"0.8em"});
gr7_tx2.setStyle({fontSize:"0.8em"});
gr7_tx3.setStyle({fontSize:"0.8em"});*/
gr7_tx1.setValue('');
gr7_tx2.setValue('<grid name="gr7_gr1" top="70" left="30" height="250" rang="10" lineHeight="16" multiSelect="true" >\n <gridHeader title="ヘッダ1" type="string" width="70" />\n <gridHeader title="ヘッダ2" type="string" width="70" />\n <gridHeader title="ヘッダ3" type="string" width="70" />\n <gridLine>\n  <gridCell value="セル1_1" />\n  <gridCell value="セル1_2" />\n  <gridCell value="セル1_3" />\n </gridLine>\n <gridLine>\n  <gridCell value="セル2_1" />\n  <gridCell value="セル2_2" />\n  <gridCell value="セル2_3" />\n </gridLine>\n <gridLine>\n  <gridCell value="セル3_1" />\n  <gridCell value="セル3_2" />\n  <gridCell value="セル3_3" />\n </gridLine>\n <gridLine>\n  <gridCell value="セル4_1" />\n  <gridCell value="セル4_2" />\n  <gridCell value="セル4_3" />\n </gridLine>\n</grid>');
gr7_tx3.setValue('<param rootNode="maskat">\n  <source obj="gr7_gr1" node="val" fromkey="2" />\n</param>');
}
gr7_text_init();
gr7_bt2.onclick = function(){
  gr7_text_init();
}

function gr7_bt1_before(param){
  gr7_tx1.setValue(param.sendXML);
}

/* 選択セル送信2 */
function gr8_text_init(){
/*gr8_tx1.setStyle({fontSize:"0.8em"});
gr8_tx2.setStyle({fontSize:"0.8em"});
gr8_tx3.setStyle({fontSize:"0.8em"});*/
gr8_tx1.setValue('');
gr8_tx2.setValue('<grid name="gr8_gr1" top="70" left="30" height="250" rang="10" lineHeight="16" multiSelect="true" >\n <gridHeader title="ヘッダ1" type="string" width="70" />\n <gridHeader title="ヘッダ2" type="string" width="70" />\n <gridHeader title="ヘッダ3" type="string" width="70" />\n <gridLine>\n  <gridCell value="セル1_1" />\n  <gridCell value="セル1_2" />\n  <gridCell value="セル1_3" />\n </gridLine>\n <gridLine>\n  <gridCell value="セル2_1" />\n  <gridCell value="セル2_2" />\n  <gridCell value="セル2_3" />\n </gridLine>\n <gridLine>\n  <gridCell value="セル3_1" />\n  <gridCell value="セル3_2" />\n  <gridCell value="セル3_3" />\n </gridLine>\n <gridLine>\n  <gridCell value="セル4_1" />\n  <gridCell value="セル4_2" />\n  <gridCell value="セル4_3" />\n </gridLine>\n</grid>');
gr8_tx3.setValue('<param rootNode="maskat">\n  <source obj="gr8_gr1" node="val" fromkey="2" idxRef="gr8_idxRefObj"/>\n</param>');
}
gr8_text_init();
gr8_bt3.onclick = function(){
  gr8_text_init();
}
gr8_bt1.onclick = function(){
  var str = "";
  for (var i = 0; i < gr8_idxRefObj.length; i++){
    for (var j = 0; j < gr8_idxRefObj[i].length; j++){
      str += "[" + gr8_idxRefObj[i][j] + "]";
    }
    str += "\n";
  }
  alert(str);
}

function gr8_bt2_before(param){
  gr8_tx1.setValue(param.sendXML);
}

var gr8_idxRefObj = new Array(4);
for (var i = 0; i < gr8_idxRefObj.length; i++){
  gr8_idxRefObj[i] = new Array(3);
  for (var j = 0; j < gr8_idxRefObj[i].length; j++){
    gr8_idxRefObj[i][j] = (i + 1) + "-" + (j + 1);
  }
}

/* ツリー:全受信 */
function tr1_text_init(){
/*tr1_tx1.setStyle({fontSize:"0.8em"});
tr1_tx2.setStyle({fontSize:"0.8em"});
tr1_tx3.setStyle({fontSize:"0.8em"});*/
tr1_tx1.setValue('');
tr1_tx2.setValue('<treeview name="tr1_tr1" boolSelActive="true" rootOpen="true" withRoot="true" withT="true">');
tr1_tx3.setValue('<result rootNode="maskat">\n  <target out="tr1_tr1" in="rows" inkey="row">\n    <bind tokey="NAME" node="name"/>\n    <bind tokey="TEXT" node="text"/>\n    <bind tokey="PARENT" node="parent"/>\n  </target>\n</result>');
}
tr1_text_init();
tr1_bt2.onclick = function(){
  tr1_text_init();
}

function tr1_bt1_after(param){
  tr1_tx1.setValue(param.xhr.responseText);
}

/* ツリー:全送信 */
function tr2_text_init(){
/*tr2_tx1.setStyle({fontSize:"0.8em"});
tr2_tx2.setStyle({fontSize:"0.8em"});
tr2_tx3.setStyle({fontSize:"0.8em"});*/
tr2_tx1.setValue('');
tr2_tx2.setValue('<treeview name="tr2_tr1" boolSelActive="true" rootOpen="true" withRoot="true" withT="true">\n  <treeNode name="root" sText="ルート">\n    <treeNode name="node1" sText="ノード1">\n      <treeNode name="node1_1" sText="ノード1_1"/>\n      <treeNode name="node1_2" sText="ノード1_2"/>\n    </treeNode>\n    <treeNode name="node2" sText="ノード2">\n      <treeNode name="node2_1" sText="ノード2_1"/>\n      <treeNode name="node2_2" sText="ノード2_2">\n        <treeNode name="node2_1_1" sText="ノード2_1_1"/>\n        <treeNode name="node2_1_2" sText="ノード2_1_2"/>\n        <treeNode name="node2_1_3" sText="ノード2_1_3"/>\n      </treeNode>\n    </treeNode>\n    <treeNode name="node3" sText="ノード3"/>\n  </treeNode>\n</treeview>');
tr2_tx3.setValue('<param rootNode="maskat">\n  <source obj="tr2_tr1" node="rows" childNode="row">\n    <bind fromkey="NAME" node="name"/>\n    <bind fromkey="TEXT" node="text"/>\n    <bind fromkey="PARENT" node="parent"/>\n  </source>\n</param>');
}
tr2_text_init();
tr2_bt2.onclick = function(){
  tr2_text_init();
}

function tr2_bt1_before(param){
  tr2_tx1.setValue(param.sendXML);
}

/* ツリー:選択ノード送信 */
function tr3_text_init(){
/*tr3_tx1.setStyle({fontSize:"0.8em"});
tr3_tx2.setStyle({fontSize:"0.8em"});
tr3_tx3.setStyle({fontSize:"0.8em"});*/
tr3_tx1.setValue('');
tr3_tx2.setValue('<treeview name="tr3_tr1" boolSelActive="true" rootOpen="true" withRoot="true" withT="true">\n  <treeNode name="root" sText="ルート">\n    <treeNode name="node1" sText="ノード1">\n      <treeNode name="node1_1" sText="ノード1_1"/>\n      <treeNode name="node1_2" sText="ノード1_2"/>\n    </treeNode>\n    <treeNode name="node2" sText="ノード2">\n      <treeNode name="node2_1" sText="ノード2_1"/>\n      <treeNode name="node2_2" sText="ノード2_2">\n        <treeNode name="node2_1_1" sText="ノード2_1_1"/>\n        <treeNode name="node2_1_2" sText="ノード2_1_2"/>\n        <treeNode name="node2_1_3" sText="ノード2_1_3"/>\n      </treeNode>\n    </treeNode>\n    <treeNode name="node3" sText="ノード3"/>\n  </treeNode>\n</treeview>');
tr3_tx3.setValue('<param rootNode="maskat">\n  <source obj="tr3_tr1" node="val" idxRef="tr3_tr1">\n    <bind fromkey="NAME" node="name"/>\n    <bind fromkey="TEXT" node="text"/>\n    <bind fromkey="PARENT" node="parent"/>\n  </source>\n</param>');
}
tr3_text_init();
tr3_bt2.onclick = function(){
  tr3_text_init();
}

function tr3_bt1_before(param){
  tr3_tx1.setValue(param.sendXML);
}

/* JSオブジェクト */
js_bt3.onclick = function(){
  alert(js_bt3_obj);
}
js_bt4.onclick = function(){
  alert(js_bt4_obj);
}
js_bt6.onclick = function(){
  alert(js_bt6_obj);
}
js_bt8.onclick = function(){
  alert(js_bt8_obj);
}
function js_text_init(){
/*js_tx1.setStyle({fontSize:"0.8em"});
js_tx2.setStyle({fontSize:"0.8em"});
js_tx3.setStyle({fontSize:"0.8em"});
js_tx4.setStyle({fontSize:"0.8em"});
js_tx5.setStyle({fontSize:"0.8em"});
js_tx6.setStyle({fontSize:"0.8em"});*/
js_tx1.setValue('');
js_tx2.setValue('');
js_tx3.setValue('');
js_tx4.setValue('');
js_tx5.setValue('<text name="js_tx1" />\n<button name="js_bt1" title="ローカル通信" />\n<text name="js_tx2" />\n<text name="js_tx3" />\n<button name="js_bt2" title="ローカル通信" />\n<button name="js_bt5" title="ローカル通信" />\n<text name="js_tx4" />\n<button name="js_bt7" title="ローカル通信" />');
js_tx6.setValue('<component id="js_bt1">\n  <event id="onclick" type="local">\n    <result>\n      <target in="js_tx1" out="js_tx2"/>\n    </result>\n  </event>\n</component>\n<component id="js_bt2">\n  <event id="onclick" type="local">\n    <result>\n      <target in="js_tx3" out="js_bt3_obj"/>\n    </result>\n  </event>\n</component>\n<component id="js_bt5">\n  <event id="onclick" type="local">\n    <result>\n      <target in="js_bt4_obj" out="js_tx4"/>\n    </result>\n  </event>\n</component>\n<component id="js_bt7">\n  <event id="onclick" type="local">\n    <result>\n      <target in="js_bt6_obj" out="js_bt8_obj"/>\n    </result>\n  </event>\n</component>');
}
js_text_init();
js_bt9.onclick = function(){
  js_text_init();
}

/* クリア */
function cl_text_init(){
/*cl_tx2.setStyle({fontSize:"0.8em"});
cl_tx3.setStyle({fontSize:"0.8em"});*/
cl_lb2.setText('Hello Maskat!');
cl_tx1.setValue('Hello Maskat!');
cl_ch1.setCheck(true);
cl_rd1.setCheck(true);
if (cl_gr1 && cl_gr1.oldColCLic){
  cl_gr1.oldColCLic.boolOrder = true; // ソート順が昇順降順入れ替わるのを阻止
}
if (cl_gr1 && cl_gr1.tabData && cl_gr1.tabData.length == 0){
  cl_gr1.fillGrid([['セル1_1', 'セル1_2', 'セル1_3'], ['セル2_1', 'セル2_2', 'セル2_3'], ['セル3_1', 'セル3_2', 'セル3_3'], ['セル4_1', 'セル4_2', 'セル4_3']]);
}
if (cl_tr1 && !cl_tr1.rootNode){
  root =cl_tr1.createAndAddNode(cl_tr1.id, {name:'root', sText:'ルート', sIcon:'images/imTreeview/pict_synthetik_off.gif', sIcon2:'', open:true, reload:false, position:'absolute'});
  node1 =cl_tr1.createAndAddNode(root.id, {name:'node1', sText:'ノード1', sIcon:'images/imTreeview/pict_synthetik_off.gif', sIcon2:'', open:true, reload:false, position:'absolute'});
  node1_1 =cl_tr1.createAndAddNode(node1.id, {name:'node1_1', sText:'ノード1_1', sIcon:'images/imTreeview/pict_synthetik_off.gif', sIcon2:'', open:true, reload:false, position:'absolute'});
  node1_2 =cl_tr1.createAndAddNode(node1.id, {name:'node1_2', sText:'ノード1_2', sIcon:'images/imTreeview/pict_synthetik_off.gif', sIcon2:'', open:true, reload:false, position:'absolute'});
  node2 =cl_tr1.createAndAddNode(root.id, {name:'node2', sText:'ノード2', sIcon:'images/imTreeview/pict_synthetik_off.gif', sIcon2:'', open:true, reload:false, position:'absolute'});
  node2_1 =cl_tr1.createAndAddNode(node2.id, {name:'node2_1', sText:'ノード2_1', sIcon:'images/imTreeview/pict_synthetik_off.gif', sIcon2:'', open:true, reload:false, position:'absolute'});
  node2_2 =cl_tr1.createAndAddNode(node2.id, {name:'node2_2', sText:'ノード2_2', sIcon:'images/imTreeview/pict_synthetik_off.gif', sIcon2:'', open:true, reload:false, position:'absolute'});
  node2_1_1 =cl_tr1.createAndAddNode(node2_2.id, {name:'node2_1_1', sText:'ノード2_1_1', sIcon:'images/imTreeview/pict_synthetik_off.gif', sIcon2:'', open:true, reload:false, position:'absolute'});
  node2_1_2 =cl_tr1.createAndAddNode(node2_2.id, {name:'node2_1_2', sText:'ノード2_1_2', sIcon:'images/imTreeview/pict_synthetik_off.gif', sIcon2:'', open:true, reload:false, position:'absolute'});
  node2_1_3 =cl_tr1.createAndAddNode(node2_2.id, {name:'node2_1_3', sText:'ノード2_1_3', sIcon:'images/imTreeview/pict_synthetik_off.gif', sIcon2:'', open:true, reload:false, position:'absolute'});
  node3 =cl_tr1.createAndAddNode(root.id, {name:'node3', sText:'ノード3', sIcon:'images/imTreeview/pict_synthetik_off.gif', sIcon2:'', open:true, reload:false, position:'absolute'});
}
cl_tx2.setValue('<label name="cl_lb2" text="Hello Maskat!" />\n<text name="cl_tx1" />\n<checkbox name="cl_ch1" text="チェックボックス" />\n<radio name="cl_rd1" text="ラジオボタン" group="myGroup" />\n<grid name="cl_gr1" multiSelect="false" >\n  <gridHeader title="ヘッダ1" />\n  <gridHeader title="ヘッダ2" />\n  <gridHeader title="ヘッダ3" />\n  <gridLine>\n    <gridCell value="セル1_1" />\n    <gridCell value="セル1_2" />\n    <gridCell value="セル1_3" />\n  </gridLine>\n  <gridLine>\n    <gridCell value="セル2_1" />\n    <gridCell value="セル2_2" />\n    <gridCell value="セル2_3" />\n  </gridLine>\n  <gridLine>\n    <gridCell value="セル3_1" />\n    <gridCell value="セル3_2" />\n    <gridCell value="セル3_3" />\n  </gridLine>\n  <gridLine>\n    <gridCell value="セル4_1" />\n    <gridCell value="セル4_2" />\n    <gridCell value="セル4_3" />\n  </gridLine>\n</grid>\n<treeview name="cl_tr1" >\n  <treeNode name="root" sText="ルート">\n    <treeNode name="node1" sText="ノード1">\n      <treeNode name="node1_1" sText="ノード1_1"/>\n      <treeNode name="node1_2" sText="ノード1_2"/>\n    </treeNode>\n    <treeNode name="node2" sText="ノード2">\n      <treeNode name="node2_1" sText="ノード2_1"/>\n      <treeNode name="node2_2" sText="ノード2_2">\n        <treeNode name="node2_1_1" sText="ノード2_1_1"/>\n        <treeNode name="node2_1_2" sText="ノード2_1_2"/>\n        <treeNode name="node2_1_3" sText="ノード2_1_3"/>\n      </treeNode>\n    </treeNode>\n    <treeNode name="node3" sText="ノード3"/>\n  </treeNode>\n</treeview>');
cl_tx3.setValue('<result>\n  <target out="cl_lb2"/>\n  <target out="cl_tx1"/>\n  <target out="cl_ch1"/>\n  <target out="cl_rd1"/>\n  <target out="cl_gr1"/>\n  <target out="cl_tr1"/>\n</result>');
}
cl_text_init();
cl_bt2.onclick = function(){
  cl_text_init();
}

/* バリデーション */
function vd_text_init(){
/*vd_tx10.setStyle({fontSize:"0.8em"});
vd_tx11.setStyle({fontSize:"0.8em"});*/
vd_tx1.setValue('');
vd_tx2.setValue('');
vd_tx3.setValue('');
vd_tx4.setValue('');
vd_tx5.setValue('');
vd_tx6.setValue('');
vd_tx7.setValue('');
vd_tx8.setValue('');
vd_tx10.setValue('<text name="vd_tx1" />\n<text name="vd_tx2" />\n<text name="vd_tx3" />\n<text name="vd_tx4" />\n<text name="vd_tx5" />\n<text name="vd_tx6" />\n<text name="vd_tx7" />\n<text name="vd_tx8" />');
vd_tx11.setValue('<source obj="vd_tx1" node="val" type="byte" />\n<source obj="vd_tx2" node="val" type="short" />\n<source obj="vd_tx3" node="val" type="int" />\n<source obj="vd_tx4" node="val" type="long" />\n<source obj="vd_tx5" node="val" type="float" />\n<source obj="vd_tx6" node="val" type="string" min="2" max="10"/>\n<source obj="vd_tx7" node="val" type="date" />\n<source obj="vd_tx8" node="val" type="time" />');
}
vd_text_init();
vd_bt10.onclick = function(){
  vd_text_init();
}

