/* flaver.js */



function setEncodeForm(){
  var html = '';
  html += '<form id="form" name="form" action="" method="get" onSubmit="return getEncode();">';
  html += '<p class="form">STRING : <input type="text" id="string" name="string" size="50" /><input type="submit" value="URL ENCODE" /></p>';
  html += '<p><textarea id="encode" name="encode" cols="50" rows="3" /></textarea></p>';
  html += '</form>';
  if(document.getElementById('EncodeForm')) document.getElementById('EncodeForm').innerHTML = html;
}

function getEncode(){
  var form = document.form;
  form.encode.value = encodeURIComponent(form.string.value);
  return false;
}

function setInputSelect(){
  try{
    var input = $$('','input');
    for(var i=0;i<input.length;i++){
      if(input[i].getAttribute('class') == 'SelectAll' || input[i].getAttribute('className') == 'SelectAll'){
        input[i].onclick = function(){ this.select(); }
        input[i].onfocus = function(){ this.select(); }
        input[i].onmouseup = function(){ this.select(); }
        input[i].readOnly = true;
      }
    }
  }catch(e){}
}

function getDownload(){
  location.href = '/webtool/flaver3/download/flaver3.zip';
  if($('thankyou-title').style.display == 'block') return false;
  var timer = setInterval(function(){
    $('thankyou-title').style.display = 'block';
    $('thankyou-message').style.display = 'block';
    clearInterval(timer);
  },2000);
  return false;
}

function setPlayer(xml){
  var html = '';
  html += '<object data="/webtool/flaver3/flaver.swf" type="application/x-shockwave-flash" width="410" height="275">';
  html += '<param name="movie" value="/webtool/flaver3/flaver.swf" />';
  html += '<param name="FlashVars" value="xml=' + xml + '" />';
  html += '<param name="allowFullScreen" value="true" />';
  html += '</object>';
  html += '<span class="info-logo">* ディスプレイ右下のREXEFロゴは動画に合成したものでプレイヤー自体には含まれません</span>';
  $('player').innerHTML = html;
  return false;
}



setOnload(setEncodeForm);

setOnload(setInputSelect);
