(function(){


										var bgIndex = 0;
										var backgroundCSS = [
											['#000000', 'url()'   , 'no-repeat', 'left top'],
											['#396ea4', 'url(back2.png)'     , 'no-repeat', 'left top'],
											['#ffffff', 'url(back3.jpg)'   , 'no-repeat', 'left top'],
											['#79caf9', 'url(back4.jpg)'      , 'no-repeat', 'left top'],
											['#9cad9d', 'url(kabegami.jpg)'    , 'no-repeat', 'right bottom'],
											['#174e8f', 'url(images/sharks.jpg)'   , 'no-repeat', 'right top'],
											['#00a9d9', 'url(images/okotowari.png)', 'no-repeat', 'center top'],
											['#e8e8e8', 'url(back8.jpg)'          , 'no-repeat'         , 'center top'],
											['#1f1f1f', ''                         , ''         , ''],
											['#9cad9d', ''                         , ''         , ''],
											['#396ea4', ''                         , ''         , ''],
											['#396ea4', ''                         , ''         , ''],
											['#e8a4c9', ''                         , ''         , '']
										];
										
										function setBackground(index) {
											var background = backgroundCSS[index];
											document.body.style.backgroundColor    = (background[0].length > 0) ? background[0] : '#ffffff';
											document.body.style.backgroundImage    = (background[1].length > 0) ? background[1] : 'none';
											document.body.style.backgroundRepeat   = (background[2].length > 0) ? background[2] : '';
											document.body.style.backgroundPosition = (background[3].length > 0) ? background[3] : '';
										}
										
										function changeBackground() {
											bgIndex = (bgIndex == backgroundCSS.length - 1) ? 0 : (bgIndex + 1);
											setBackground(bgIndex);
										}
										
										Ext.onReady(function(){
										
											bgIndex = Math.floor(Math.random() * 12);
											setBackground(bgIndex);
										
										
											var changeBackgroundButtonTitle = '�w�i';
											new Ext.Button({
												renderTo:document.body,
												id:'preferenceButton',
												text:changeBackgroundButtonTitle+'�i'+(bgIndex+1)+'/'+backgroundCSS.length+'�j',
												minWidth:'80',
												handler:function(){
													changeBackground();
													this.setText(changeBackgroundButtonTitle+'�i'+(bgIndex+1)+'/'+backgroundCSS.length+'�j');
												}
											});
										
										
											var videoWindow = new Ext.Window({
												layout:'fit',
												title:'Video',
												x:10,
												y:20,
												width:540,
												height:420+28,
												constrainHeader:true,
												maximizable:true,
												items:new Ext.TabPanel({
													border:false,
													frame:true,
													resizeTabs:true,
													minTabWidth:80,
													tabWidth:80,
													activeTab: 0,
													items: [
														{
														title: 'Justin',
														html: '<object type="application/x-shockwave-flash" width="100%" height="100%" id="live_embed_player_flash_justin" class="video-related" data="http://ja.justin.tv/widgets/live_embed_player.swf?channel=" bgcolor="#000000" wmode="transparent"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><param name="allowNetworking" value="all"><param name="movie" value="http://ja.justin.tv/widgets/live_embed_player.swf"><param name="flashvars" value="channel=&auto_play=true&consumer_key=&start_volume=25"><param name="wmode" value="transparent"></object>'
														},{
														title: 'Ustream',
														html: '<object type="application/x-shockwave-flash" width="100%" height="100%" id="live_embed_player_flash_ustream" class="video-related" data="http://www.ustream.tv/flash/live/3034451" bgcolor="#000000" wmode="transparent"><param name="allowfullscreen" value="true"><param name="allowscriptaccess" value="always"><param name="allowNetworking" value="all"><param name="movie" value="http://www.ustream.tv/flash/live/3034451"><param name="flashvars" value="autoplay=true&brand=embed&cid=3034451"><param name="wmode" value="transparent"></object>'
														}
													]
												})
											});
											videoWindow.show();
											
											var chatWindow = new Ext.Window({
												layout:'fit',
												title:'Chat',
												x:540+10,
												y:20,
												width:380+10,
												height:420+28,
												constrainHeader:true,
												maximizable:true,
												items:new Ext.TabPanel({
												border:false,
												frame:true,
													resizeTabs:true,
													minTabWidth:80,
													tabWidth:80,
													activeTab: 0,
													items: [
														{
														title: 'Ust Chat',
														html: '<embed width="100%" height="100%" type="application/x-shockwave-flash" flashvars="brandId=1&channel=#the-owl-box&server=chat1.ustream.tv&style=c15428b:bdeecfd:r8db2e3:hbdeecfd:hc15428b" pluginspage="http://www.adobe.com/go/getflashplayer" src="http://www.ustream.tv/flash/irc.swf" allowfullscreen="true" wmode="window">'
														}/*,{
														title: 'Ust Twitter',
														html: '<iframe src="http://www.ustream.tv/twitterjs/iframe?cid=3034451&prefix=punsuke&suffix=+#the-owl-box+live+at+http://www.ustream.tv/channel/the-owl-box+%29" width=100% height=100% marginwidth=100% marginheight=100%></iframe>'
														}*/
													]
												})
											});
											chatWindow.show();
											
											var infoWindow = new Ext.Window({
												layout:'fit',
												title:'information',
												x:10,
												y:470,
												width:930,
												height:270,
												constrainHeader:true,
												maximizable:true,
												items:new Ext.TabPanel({
													border:false,
													frame:true,
													resizeTabs:true,
													minTabWidth:120,
													tabWidth:120,
													activeTab: 0,
													items: [
														{
														title: 'Wiki',
														html: '<iframe src="http://777labo.com/mychecker/wiki/?The+Owl+Box width=100% height=100% marginwidth=100% marginheight=100%></iframe>'
														},{
														title: 'Simple Checker',
														html: '<iframe src="http://777labo.com/mychecker/simple.php" width=100% height=100% marginwidth=100% marginheight=100%></iframe>'
														},{
														title: 'search',
														html: '<iframe src="http://777labo.com/mychecker/search_view.php" width=100% height=100% marginwidth=100% marginheight=100%></iframe>'
														},{
														title: 'MyBOT',
														html: '<iframe src="http://777labo.com/mychecker/twitter_view.php" width=100% height=100% marginwidth=100% marginheight=100%></iframe>'
														},{
														title: 'tag',
														html: '<iframe src="http://777labo.com/mychecker/tag_view.php?name=The Owl Box" width=100% height=100% marginwidth=100% marginheight=100%></iframe>'
														}												]
												})
											});
											infoWindow.show();
											
											/*
											var twitterWindow = new Ext.Window({
												layout:'fit',
												title:'Twitter',
												x:790,
												y:10,
												width:200,
												height:320+28,
												constrainHeader:true,
												maximizable:true,
												items:new Ext.TabPanel({
													border:false,
													frame:true,
													resizeTabs:true,
													minTabWidth:80,
													tabWidth:80,
													activeTab: 0,
													items: [
														{
														title: 'TwitterBOT',
														html: '<iframe src="http://777labo.com/mychecker/twitter_view.php" width=100% height=100% marginwidth=100% marginheight=100%></iframe>'
														},{
														title: 'Ustream',
														html: '<object type="application/x-shockwave-flash" width="100%" height="100%" id="live_embed_player_flash_ustream" class="video-related" data="http://www.ustream.tv/flash/live/3034451" bgcolor="#000000" wmode="transparent"><param name="allowfullscreen" value="true"><param name="allowscriptaccess" value="always"><param name="allowNetworking" value="all"><param name="movie" value="http://www.ustream.tv/flash/live/3034451"><param name="flashvars" value="autoplay=true&brand=embed&cid=3034451"><param name="wmode" value="transparent"></object>'
														}
													]
												})
											});
											twitterWindow.show();
											*/
});
})();




				
