/* (c) clwit, Inc. All rights reserved. */
(function(){var e="1.0b019";var c=200;var f=125;var b=450;var a=200;var i=70;var g=45;var j=function(){var p=document.getElementById("bpWidth");var k=document.getElementById("bpHeight");var m=document.getElementById("bpTitleHeight");if(!p||!k||!m){return}var l=0;if(isNaN(p.value)){p.value=c}l=Number(p.value);var n=0;if(isNaN(k.value)){k.value=b}n=Number(k.value);var o=0;if(isNaN(m.value)){m.value=i}o=Number(m.value);if(l<f){l=f;p.value=l}if(n<a){n=a;k.value=n}if(o<g){o=g;m.value=o}if((o+100)>n){o=(n-100);m.value=o}return true};var d=function(){if(!j()){return}var s=document.getElementById("textBpSrc");var r=document.getElementById("channelId");var m=document.getElementById("categoryId");if(!s||!r||!m){return}var k;var w=document.getElementById("bpWidth");if(w){k=w.value}if(isNaN(k)){k=c}var o;var p=document.getElementById("bpHeight");if(p){o=p.value}if(isNaN(o)){o=b}var x;var v=document.getElementById("bpTitleHeight");if(v){x=v.value}if(isNaN(x)){x=i}var t=k-2;var u=x;var n=o-u-20-4;var l=new Array();l.push("<iframe ");l.push('src="http://'+m.value+".chat.wiwit.jp/");l.push("main.pl?");l.push("bp=1&");l.push("ch="+r.value+"&");l.push("vwi="+t+"&");l.push("vlhe="+n+"&");l.push("vthe="+u+"");l.push('" ');l.push('width="'+k+'" ');l.push('height="'+o+'" ');l.push('frameborder="0" ');l.push('scrolling="no" ');l.push('title="wiwit-chat" ');l.push(">");l.push("</iframe>");s.value=l.join("");if(l.length>1){l[1]='src="/'}var q=document.getElementById("divSampleBp");if(q){q.innerHTML=l.join("")}return};window.updateWchatBpSrc=d;var h=function(){var k=null;k=document.getElementById("bpWidth");if(k){k.value=c}k=document.getElementById("bpHeight");if(k){k.value=b}k=document.getElementById("bpTitleHeight");if(k){k.value=i}d()};window.onload=h})();