/*===================================================== 
 Copyright (C) ETERNAL<iqstar.tw@gmail.com>
 Modify : 2005/09/17
 URL : http://www.2233.idv.tw
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.
===================================================== */
var wog_log = new Array();
var p_width=0,p_height=0,Pimg = new Image();
var p_status="";
var p_name="";
var my_birth="";
var my_age="";
var m_name="";
var temp_tebla1='<table width="97%" border="1" cellspacing="0" cellpadding="2" align="center" bordercolor="#4B689E">';
var fight_temp_tebla1='<table width="600" border="1" cellspacing="0" cellpadding="2" align="center" bordercolor="#4B689E">';
var temp_tebla2='</table>';
var changelink='onmouseover="this.style.color=\'#3366FF\'" onmouseout="this.style.color=\'white\'" style="cursor:pointer"';
var tr_bgcolor="#4B689E";
var hr='';//hr='<hr width="95%" size="1" color="#">';
var hr1='<hr width="95%" size="1" color="#238CBE">';
var vData="";
var online_temp_tebla1='<table width="100%" border="0" cellspacing="0" cellpadding="2" align="center">';
var temp_cp_tebla1='<table width="80%" border="0" cellspacing="0" cellpadding="0" class="b1">';
var view_name=parent.wog_view;
var cp_jmmoney=0;
var img="./img/"
var pic="./img/shop/";
var mimg="./img/monster/"
var mid_file="";
var bbs_id="";
var nosend="#392724";
var p_sat_name="",d_a_name="",d_body_name="",d_head_name="",d_hand_name="",d_foot_name="",d_item_name="",d_ride_name="",d_spirit_name="",d_title_name="",d_state_name="",p_group="",p_style="",d_p_url="",d_ch_name="",d_s_ch_name="",d_p_homename="";
var pet_pname="",pet_mname="",t_team="",p_support_name="",pet_img="",p_support_img="";
var fightrow = new Array;
var fight_num=0;
var shock_num=0,shock_s="";
var temp_obj="";
var gf="";
var gt="";
var temp_p_hp=0;
var temp_p_hpmax=0;
var new_player="沒有新玩家"; 
var temp_m_hp=0;
var temp_m_hpmax=0;
var player_num=0;
var	tmpNum="";
sec=new Array()
sec[0]="未知區域";
sec[1]="中央平原";
sec[2]="試鍊洞窟";
sec[3]="黑暗沼澤";
sec[4]="迷霧森林";
sec[5]="古代遺跡";
sec[6]="久遠戰場";
sec[7]="王者之路";
sec[8]="幻獸森林";
sec[9]="星河異界";
sec[10]="灼熱荒漠";
sec[11]="無淵洞窟";
sec[12]="天空之城";
sec[13]="水晶之間";
sec[14]="失落古船";
sec[15]="最果之島";
sec[16]="魂魄之路";
sec[17]="黑暗魔門";
sec[18]="屍骨魔殿";
sec[19]="真血之城";
sec[20]="卡通裂縫";
sec[21]="三國戰曲";
sec[22]="戰國世界";
sec[23]="幻影魔流";
sec[24]="採礦區";
sec[25]="黑道戰場";
sec[26]="精靈墓地";
sec[27]="無名國都";
sec[28]="虛界皇朝";
sec[29]="水滸樂園";
sec[30]="虛念之界";
sec[31]="龍族墓地";
sec[32]="虛幻迷宮";
birth=new Array()
birth[0]="中央大陸";
birth[1]="魔法王國";
birth[2]="熱帶雨林";
birth[3]="末日王城";
birth[4]="真魔王國";
birth[5]="時間鎖鏈";
birth[6]="特殊地區";
birth[7]="五行三界";
birth[8]="迷失世界";
var well=new Array(); 
well[0]=new well_data('戰神','win'); 
well[1]=new well_data('等級','lv'); 
well[2]=new well_data('血盾','hp'); 
well[3]=new well_data('勇者','at'); 
well[4]=new well_data('法師','mat'); 
well[5]=new well_data('魅影','agl'); 
well[6]=new well_data('轉生','rebirth');
well[7]=new well_data('紅人','pk'); 
well[8]=new well_data('鳥冠','race'); 
well[9]=new well_data('現金','money'); 
well[10]=new well_data('存款','bank'); 
function well_data(title,type,temp_str){this.title=title,this.type=type,this.temp_str='',this.time=0;} 
function rank_view(key) 
{ 
   message_cls(); 
   var f=parent.wog_view.document; 
   f.write(''); 
   f.write(temp_tebla1); 
   f.write('<tr><td colspan="12" align="center">Fate Wog十大玩家排行榜</td></tr>'); 
   f.write('<tr>'); 
   for(var i=0;i < well.length;i++) 
   { 
      f.write('<td '+(i!=key?'onmouseover="this.style.color=\'#4B689E\'" onmouseout="this.style.color=\'white\'" onclick="parent.wog_view.location.href=\'wog_etc.php?f=king&type='+well[i].type+'&time='+well[i].time+'\'" style="cursor:pointer"':'bgcolor="#4B689E"')+'>'+well[i].title+'</td>'); 
   } 
   f.write('</tr>'+temp_tebla2); 
   if(key != null) 
   { 
      var temp_str=""; 
      temp_str=well[key].temp_str; 
      if(temp_str) 
      { 
         f.write(temp_tebla1+'<br>'); 
         var s=temp_str.split(";"); 
         var ccc=0; 
         for(var j=0;j < s.length;j++) 
         { 
            ccc += 1;
            var s1=s[j].split(","); 
            var pic=new Image(); 
            pic.src=s1[0].indexOf("http") == -1?img+s1[0]+(s1[0].lastIndexOf('.')!=-1?'':'.gif'):s1[0]; 
            var p_img_url='<img src="'+pic.src+'" border="0" id="pic'+j+'">'; 
            f.write('<tr><td width="10%">No <font color="#FFFF00">'+ccc+'</font></td><td width="25%">'+p_img_url+'</td><td width="25%">'+s1[1]+'</td><td width="40%">'+s1[2]+'</td></tr>'); 
            var pPic=parent.wog_view.document.getElementById('pic'+j); 
            if(pic.height>150) 
            pPic.style.height=150; 
            if(pic.width>150) 
            pPic.style.width=150; 
         } 
         f.write(temp_tebla2); 
      }
   } 
}
function get_temp_tebla1() {return temp_tebla1;}
function get_temp_tebla2() {return temp_tebla2;}
function setup_name(name) 
{
	p_name=name;
}
function setup_bbsid(bbsid)
{
	if(bbs_id=="")
	{
		bbs_id=bbsid;
	}
}
function setup_sat_name(psat)
{
	if(bbs_id=="")
	{
		p_sat_name=psat;
	}
	
}
function setup_mname(name) {m_name=name;}
function setup_jmmoney(money) {cp_jmmoney=money;}
function get_name() {return p_name;}
function get_mname() {return m_name;}
function chat_view() 
{ 
   var view=parent.chat.document; 
   view.close(); 
   view.write('<html>'); 
   view.write('<head>'); 
   view.write('<meta http-equiv="Content-Type" content="text/html; charset=big5">'); 
   view.write('<meta http-equiv=Cache-Control content="no-cache">'); 
   view.write('<META HTTP-EQUIV="Refresh" CONTENT=20 src="chat.php"> '); 
   view.write('<style type=text/css>'); 
   view.write('td {font-family : verdana,Arial,Helvetica ;font-size : 10pt;   text-align : center;}'); 
   view.write('</style>'); 
   view.write('</head>'); 
   view.write('<body bgcolor="#000000" text="#EFEFEF" link="#EFEFEF" vlink="#EFEFEF" alink="#EFEFEF" style="Background-attachment:fixed; Background-image: url('+img+'W_hs03.gif);">'); 
} 
function chat_set_view() 
{ 
   var view=parent.wog_view.document; 
   message_cls(); 
   view.write(''); 
   view.write('<form name="frm">'); 
   view.write(temp_tebla1); 
   view.write('<tr><td bgcolor="#4B689E" align="center" colspan="4">聊天室設定</td></tr>'); 
   view.write('<cols width="30%" align="center"><cols width="70%">'); 
   view.write('<tr><td>一般設定</td><td>'); 
   view.write('<input type="checkbox" name="face_use" checked> 發言使用表情符號<br>'); 
   view.write('<input type="checkbox" name="fastcode_use" checked> 發言使用動作代碼<br>'); 
   view.write('</td></tr>'); 
   view.write('<tr><td>頻道開關</td><td colspan="3">'); 
   view.write('一般頻道 <input type="radio" name="channel1" value="0">關閉 <input type="radio" name="channel1" value="1" checked>開啟<br>'); 
   view.write('公會頻道 <input type="radio" name="channel2" value="0">關閉 <input type="radio" name="channel2" value="1" checked>開啟<br>'); 
   view.write('隊伍頻道 <input type="radio" name="channel3" value="0">關閉 <input type="radio" name="channel3" value="1" checked>開啟<br>'); 
   view.write('密語頻道 <input type="radio" name="channel4" value="0" disabled="true">關閉 <input type="radio" name="channel4" value="1" checked>開啟<br>'); 
   view.write('交易頻道 <input type="radio" name="channel8" value="0">關閉 <input type="radio" name="channel8" value="1" checked>開啟<br>'); 
   view.write('問答頻道 <input type="radio" name="channel9" value="0">關閉 <input type="radio" name="channel9" value="1" checked>開啟<br>'); 
   view.write('警告頻道 <input type="radio" name="channel6" value="0" disabled="true">關閉 <input type="radio" name="channel6" value="1" checked>開啟<br>'); 
   view.write('管理頻道 <input type="radio" name="channel5" value="0" disabled="true">關閉 <input type="radio" name="channel5" value="1" checked>開啟<br>'); 
   view.write('公告頻道 <input type="radio" name="channel7" value="0" disabled="true">關閉 <input type="radio" name="channel7" value="1" checked>開啟<br>'); 
   view.write('</td></tr>'); 
   view.write('<tr><td colspan="4"><input type="button" value="設定完成" onclick="parent.chat_set()"></td></tr>'); 
   view.write(temp_tebla2); 
   view.write('</form>'); 
   var chat_arr=Gookie('wog_chat_cookie'); 
   if(chat_arr != null) 
   { 
      var f=parent.wog_view.frm; 
      chat_arr=chat_arr.split(','); 
      f.face_use.checked=chat_arr[0]=='1'?true:false; 
      f.fastcode_use.checked=chat_arr[1]=='1'?true:false; 
      f.channel1[(chat_arr[2]=='0'?0:1)].checked=true; 
      f.channel2[(chat_arr[3]=='0'?0:1)].checked=true; 
      f.channel3[(chat_arr[4]=='0'?0:1)].checked=true; 
      f.channel4[(chat_arr[5]=='0'?0:1)].checked=true; 
      f.channel5[(chat_arr[6]=='0'?0:1)].checked=true; 
      f.channel6[(chat_arr[7]=='0'?0:1)].checked=true;
      f.channel7[(chat_arr[8]=='0'?0:1)].checked=true;
      f.channel8[(chat_arr[9]=='0'?0:1)].checked=true;
      f.channel9[(chat_arr[10]=='0'?0:1)].checked=true;
   } 
} 
function chat_set() 
{ 
   var f=parent.wog_view.frm; 
   var chat_arr=[]; 
   chat_arr.push(f.face_use.checked==true?'1':'0'); 
   chat_arr.push(f.fastcode_use.checked==true?'1':'0'); 
   chat_arr.push(f.channel1[1].checked==true?'1':'0'); 
   chat_arr.push(f.channel2[1].checked==true?'1':'0'); 
   chat_arr.push(f.channel3[1].checked==true?'1':'0'); 
   chat_arr.push(f.channel4[1].checked==true?'1':'0'); 
   chat_arr.push(f.channel5[1].checked==true?'1':'0'); 
   chat_arr.push(f.channel6[1].checked==true?'1':'0'); 
   chat_arr.push(f.channel7[1].checked==true?'1':'0'); 
   chat_arr.push(f.channel8[1].checked==true?'1':'0'); 
   chat_arr.push(f.channel9[1].checked==true?'1':'0'); 
   chat_arr=chat_arr.toString(','); 
   Sookie('wog_chat_cookie',chat_arr); 
   job_end(3); 
} 
var chat_timer="";
var act_tebla = new Array();
act_tebla[0]= new act_tebla_data('pay','&name 對 &aim 說：下次我會找你報仇');
act_tebla[1]= new act_tebla_data('chap','&name 對 &aim 說：你這個臭小子！');
act_tebla[2]= new act_tebla_data('rob','&name 對 &aim 說：打劫，把錢交出來！');
act_tebla[3]= new act_tebla_data('brawl','&name 對 &aim 說：我好累別吵我！');
act_tebla[4]= new act_tebla_data('help','&name 對 &aim 說：啊！救命阿！外星人來了！！');
act_tebla[5]= new act_tebla_data('kiss','&name 發瘋了!他狂親 &aim 的嘴巴');
act_tebla[6]= new act_tebla_data('gas','&name 對 &aim 說：『教而不善，激到嘔電』');
act_tebla[7]= new act_tebla_data('dinosaur','&name 召喚了Ｎ隻恐龍攻擊 &aim');
act_tebla[8]= new act_tebla_data('kick','&name 踢了 &aim 一腳，&aim 飛出九重天外');
act_tebla[9]= new act_tebla_data('punch','&name 搥了 &aim 的小弟弟一拳，致命的一下');
act_tebla[10]= new act_tebla_data('glance','&name 瞪了 &aim 一眼，&aim 就暈了過去');
act_tebla[11]= new act_tebla_data('thank','&name 對 &aim 說了一句謝謝...^.^');
act_tebla[12]= new act_tebla_data('HI','&name 對 大家 說大家好∼');
act_tebla[13]= new act_tebla_data('hit','&name 打到 &aim 的口角流血');
act_tebla[14]= new act_tebla_data('love','&name 向 &aim 說：我愛你一萬年！');
act_tebla[15]= new act_tebla_data('xyz','&name 向 &aim 爆說三字經，xzy 你呀!!');
act_tebla[16]= new act_tebla_data('uplv','&name 向 大家 說萬歲！我升級了！');
act_tebla[17]= new act_tebla_data('kill','&name 先把 &aim 拳打腳踢，後用雙刀左斬右斬，再用無影手左刮右刮！');
act_tebla[18]= new act_tebla_data('kiss2','&name 把 &aim 抱住，兩人深情地望著對方，啜卜……');
act_tebla[19]= new act_tebla_data('help2','&name 向 大家 說救命丫!!!!!色狼來了!!!!!');
act_tebla[20]= new act_tebla_data('ak','&name &name 大喊 :『 &aim 在嗎 ??』');
act_tebla[21]= new act_tebla_data('agree','&name 完全同意 &aim');
act_tebla[22]= new act_tebla_data('bark','&name 像隻狗似的亂吠');
act_tebla[23]= new act_tebla_data('blink','&name 眨眨眼睛，一臉無辜的樣子');
act_tebla[24]= new act_tebla_data('face','&name 頑皮的對 &aim 做了個鬼臉');
act_tebla[25]= new act_tebla_data('buddha','&name 在這一瞬間，覺得 &aim 簡直跟神一樣');
act_tebla[26]= new act_tebla_data('clap','&name 用力地鼓掌');
act_tebla[27]= new act_tebla_data('fear2','&name 對 &aim 說：「怕了吧！　哈哈哈！」');
act_tebla[28]= new act_tebla_data('dance','&name 自得其樂的跳著舞');
act_tebla[29]= new act_tebla_data('flook','&name 痴痴的望著 &aim ，那深情的眼神說明了一切');
act_tebla[30]= new act_tebla_data('fool','&name 露出像傻瓜般的笑容....：O~');
act_tebla[31]= new act_tebla_data('die','&name 直挺挺的倒在地上 ... 死了∼');
act_tebla[32]= new act_tebla_data('flog','&name 揮了揮手上的寶物，來搶我啊！來啊！！');
act_tebla[33]= new act_tebla_data('greet','&name 愉快地向在場的所有人打招呼');
act_tebla[34]= new act_tebla_data('laugh','&name 笑得倒在地上打滾');
act_tebla[35]= new act_tebla_data('hammer','&name 舉起好大好大的鐵槌往 &aim 頭上用力一敲！　*** 『! 鏘 !』 ***.  ( 500000000 Pt )');
act_tebla[36]= new act_tebla_data('headshake','&name 搖搖頭，一副很無辜的樣子');
act_tebla[37]= new act_tebla_data('bye','&name 用力揮著他的手，大聲的說 : 大家掰掰囉！');
act_tebla[38]= new act_tebla_data('grin','&name 的臉上露出 &aim 的笑容');
act_tebla[39]= new act_tebla_data('hmm','&name「嗯」的一聲，開始思考…');
act_tebla[40]= new act_tebla_data('smirk','&name 裂開大嘴呵呵地傻笑');
act_tebla[41]= new act_tebla_data('bad','&name 對 &aim 說「小子，人情留一線，日後好相見」');
act_tebla[42]= new act_tebla_data('waggle','&name 搖搖食指說：「這樣不可以喔!!」');
act_tebla[43]= new act_tebla_data('howl','&name 對著天空狼嚎　ao∼wu∼∼，ao∼wu∼∼');
act_tebla[44]= new act_tebla_data('ya','&name 作出勝利的 V 字，高興的喊了聲『 YA !! 』');
act_tebla[45]= new act_tebla_data('idiot','&name 突然覺得自己從沒像現在這麼愚蠢過');
act_tebla[46]= new act_tebla_data('nod','&name 點點頭');
act_tebla[47]= new act_tebla_data('?','&name 的臉上露出疑惑的表情');
act_tebla[48]= new act_tebla_data('shrug','&name 聳聳肩，一臉無奈的表情');
act_tebla[49]= new act_tebla_data('stare','&name 深深地注視著藍天');
act_tebla[50]= new act_tebla_data('kill2','&name 很酷的掏出一把槍，「碰！」一槍把 &aim 給斃了');
act_tebla[51]= new act_tebla_data('strut','&name 很臭屁的大搖大擺、走來走去');
act_tebla[52]= new act_tebla_data('moan','&name 輕聲的呻吟著...');
act_tebla[53]= new act_tebla_data('sigh','&name 深深地歎了一口氣');
act_tebla[54]= new act_tebla_data('peer','&name 用懷疑的眼光看 &aim ');
act_tebla[55]= new act_tebla_data('blush','&name 羞得整個臉紅通通的 >////<');
act_tebla[56]= new act_tebla_data('love2','喔∼ &aim 是多麼迷人， &name 想自己是愛上 &aim 了');
act_tebla[57]= new act_tebla_data('singg','&name 向前面的 &aim 唱起了「對面的恐龍看過來......」');
act_tebla[58]= new act_tebla_data('marry','&name 向 &aim 求婚：妳能嫁給我嗎？');
act_tebla[59]= new act_tebla_data('singb','&name 向前面的 &aim 唱起了「對面的宅男看過來......」');
act_tebla[60]= new act_tebla_data('pet','&name 把 &aim 抓去寵物牧場養了');
act_tebla[61]= new act_tebla_data('1hp','&name 在僅存1hp時、終於在第149回合把 &aim 給KO了');
act_tebla[62]= new act_tebla_data('pout','&name 不高興的嘟起嘴來');
act_tebla[63]= new act_tebla_data('zzz','&name 揉了揉雙眼、打了個呵欠，想睡教教了~');
act_tebla[64]= new act_tebla_data('ppp','&name 用臉頰輕輕地磨擦著 &aim 的粉臉，悄聲說道：我好喜歡妳哦...');
act_tebla[65]= new act_tebla_data('praise','&name 對 &aim 說道：果然高明！佩服佩服！');
act_tebla[66]= new act_tebla_data('puke','&name 突然覺得胃一陣抽筋，哇啦哇啦地吐了滿地');
act_tebla[67]= new act_tebla_data('sing','&name 含情默默的唱起歌來：「 &aim 」');
act_tebla[68]= new act_tebla_data('spank','&name 用力拍著 &aim 的背，一副「好小子！干的好」的表情');
act_tebla[69]= new act_tebla_data('tender','&name 懇切地給予 &aim 溫暖同情的眼神！');
act_tebla[70]= new act_tebla_data('thx','&name 眼中閃著淚光，似乎非常的感激');
act_tebla[71]= new act_tebla_data('wrong','&name 對 &aim 說道：你錯了！');
act_tebla[72]= new act_tebla_data('zap','&name 從天上召來一道閃電，把 &aim 劈成黑碳了！');
act_tebla[73]= new act_tebla_data('d2d','&name 突然捉住 &aim 的腳，大叫：「是你！就是你！我發現我愛上你了！');
function act_tebla_data(title,sentence){this.title=title,this.sentence=sentence;}
function chat_act_view() 
{ 
	var f=parent.wog_view.document; 
	message_cls(); 
	f.write(temp_tebla1);
	f.write('<tr><td bgcolor="#4B689E" align="center" colspan="4">聊天室動作列表</td></tr>'); 
	f.write('<tr><td align="center" colspan="4">注意：動作中出現&aim的請在動作代碼打一個空白鍵，再打上對方名字。</td></tr>');
	var act_show=""; 
	for(var j=0;j < act_tebla.length;j++) 
	{ 
		act_show=(j % 2 == 0?'<tr>':'')+'<td '+changelink+' width=10% onclick=parent.chat_input.document.frm.message.focus();parent.chat_input.document.frm.message.value="/'+act_tebla[j].title+'";><b>'+act_tebla[j].title+'</b></td><td width=40%>'+act_tebla[j].sentence+'</td>';
		f.write(act_show);
	}
	f.write(temp_tebla2); 
} 
function window_open(a,b,c)
{
	if(a!="")
	{
		alert(a);
	}
	window.open(b,c);
}
function datechk(s,f)
{
	var act_value="";
	var temp_id_value="";
	var fight_mode="";
	var error="";
	var temp_id2_value="";
	if(s.f_count.value > 150)
	{
		error="戰鬥回合數不能大於"+f_count;
	}
	if(s.f_count.value < 1)
	{
		error="戰鬥回合數不能小於1";
	}
	switch(true){
		case s.a_type[0].checked:
			act_value=s.act1.value;
			temp_id_value='0';
		break;
		case s.a_type[1].checked:
			act_value='50';
			temp_id_value='1';
		break;
		case s.a_type[2].checked:
			act_value='51';
			temp_id_value='2';
		break;
		case s.a_type[3].checked:
			act_value='0';
			temp_id_value='3';
		break;
	}
	if(act_value=="")
	{
		error="請選擇場地";
	}
	if(s.f_mode[0].checked==false && s.f_mode[1].checked==false)
	{
		error="請選擇攻擊方式";
	}
	if(s.f_mode[0].checked==true)
	{
		fight_mode=1;
	}
	if(s.f_mode[1].checked==true)
	{
		fight_mode=2;
	}
	if(error != "")
	{
		alert(error);
	}else
	{
		if(s.a_mode[0].checked==true)
		{
			temp_id2_value=1;
		}
		if(s.a_mode[1].checked==true)
		{
			temp_id2_value=2;
		}
		Sookie("wog_fight", temp_id_value+","+act_value+","+temp_id2_value+","+s.act_area.value+","+fight_mode+","+s.f_count.value+","+s.f_hp.value);
		p_sat_name=s.sat_name.value;
		if(!x)
		{
			job_end('27');
		}else
		{
			firechk();
		}
	}
}
function firechk()
{
	var set=Gookie("wog_fight");
	if(!set)
	{
		ad_view('0');
	}else
	{
		var s1=set.split(",");
		if(s1[0]=='3')
		{
			act_click('group','fire_list_peo');
		}else{
		var thisfrom=parent.foot.document.f1;
		var error="";
		if(thisfrom.ats1.disabled==true)
		{
			error="8秒內不能戰鬥";
		}
		if(s1[5] > 150)
		{
			error="戰鬥回合數不能大於"+f_count;
		}
		if(s1[0]=="1" && s1[1]=="50")
		{
			if(!confirm("挑戰冠軍需付一百萬費用"))
			{
				error="結束挑戰";
			}
		}
		if(s1[0]=="2" && s1[1]=="51")
		{
			if(thisfrom.towho.value=="")
			{
				error="沒有選擇對像不能PK";
			}else
			{
				s1[3]=thisfrom.towho.value;
			}
			s1[0]="1";
		}
		
		if(s1[0]=="3")
		{
			s1[0]="2";
		}
		if(error != "")
		{
			alert(error);
		}else
		{
			thisfrom.f.value="fire";
			thisfrom.action="wog_fight.php";
			thisfrom.act.value=s1[1];
			thisfrom.temp_id.value=s1[0];
			thisfrom.temp_id2.value=s1[2];
			thisfrom.at_type.value=s1[4];
			thisfrom.sat_name.value=p_sat_name;
			thisfrom.temp_id3.value=s1[5];
			thisfrom.temp_id4.value=s1[6];
			thisfrom.submit();
			}
		}
	}
}
function change_mission(s,f)
{
	var thisfrom=f;
	if(s==0)
	{
		thisfrom.a_type[0].checked=true;
	}else if(s==1)
	{
		thisfrom.a_type[1].checked=true;
	}
}
function foot_disabled()
{
	for(var i=0;i<parent.foot.document.f1.elements.length;i++)
	{
		parent.foot.document.f1.elements[i].disabled=true;
	}
}
function foot_fire()
{
	for(var i=0;i<parent.foot.document.f1.elements.length;i++)
		{  
			parent.foot.document.f1.elements[i].disabled=false;
		}
}
function set_status(lv,hp,hpmax,exp,maxexp) 
{ 
	var f=parent.foot.document; 
	f.getElementById("p_lv").innerHTML = lv; 
	if(hp - hpmax > 0){
		hpx = 120; 
	}else{
		hpx = hp/hpmax*120; 
	}
	if(exp - maxexp > 0){
		expx = 180; 
	}else{
		expx = exp/maxexp*180; 
	}
	f.getElementById("p_hp").width = hpx; 
	f.getElementById("p_hp").alt = hp+"/"+hpmax; 
	f.getElementById("p_exp").width = expx; 
	f.getElementById("p_exp").alt = exp+"/"+maxexp; 
	f.getElementById("p_hpb").innerHTML = (hp/hpmax*100).toFixed(1) + "%"; 
	f.getElementById("p_expb").innerHTML = (exp/maxexp*100).toFixed(1) + "%"; 
} 
//##### page head begin #####
function message_cls(a,bline) {
	var ff=parent.wog_view.document;
	if(a!=null)
	{
		ff=a;
	}
	if(bline==null)
	{
		bline=2;
	}
	ff.close();
    ff.write('<html>');
    ff.write('<head>');
    ff.write('<meta http-equiv="Content-Type" content="text/html; charset=big5">');
    ff.write('<meta http-equiv=Cache-Control content="no-cache">');
	ff.write('<style type=text/css>');
	ff.write('body { SCROLLBAR-FACE-COLOR: #6699FF; SCROLLBAR-HIGHLIGHT-COLOR: #fcfcfc; SCROLLBAR-SHADOW-COLOR: #fcfcfc; SCROLLBAR-3DLIGHT-COLOR: #9999FF; SCROLLBAR-ARROW-COLOR: #99ccFF; SCROLLBAR-DARKSHADOW-COLOR: #9933FF; SCROLLBAR-BASE-COLOR: #6699FF; }');
    ff.write('td {font-family : verdana,Arial,Helvetica ;font-size : 10pt;	text-align : center;}');
    ff.write('.b1 {text-align : left;}');
    ff.write('input{background-color: #ffffff; color:#000000; BORDER: #7b9ebd 1px solid; cursor:hand; height: 22px;}');
    ff.write('</style>');
    ff.write('</head>');
    ff.write('<body oncontextmenu="window.event.returnValue=false" bgcolor="#000000" text="#EFEFEF" link="#EFEFEF" vlink="#EFEFEF" alink="#EFEFEF" style="Background-attachment:fixed; background-image: url('+img+'W_hs03.gif);" >');
    ff.write('<div id="showboard" name="showboard" style="display:none;position:absolute"></div>'); //border:2px solid #191970;是小視窗的BORDER
}
//####### fight begin #######
function Sookie(name, value) { 
	document.cookie = name + "=" + value
} 
function Gookie(name) { 
	var arg = name + "=";
	var alen = arg.length; 
	var clen = document.cookie.length; 
	var i = 0; 
	while (i < clen) { 
		var j = i + alen; 
		if (document.cookie.substring(i, j) == arg) 
			return GookieVal (j); 
		i = document.cookie.indexOf(" ", i) + 1; 
		if (i == 0) break; 
	} 
	return null; 
}
function GookieVal(offset) { 
	var endstr = document.cookie.indexOf (";", offset); 
	if (endstr == -1) 
		endstr = document.cookie.length; 
	return document.cookie.substring(offset, endstr); 
}
function select_area(num,s)
{
	var ctr=0;
	s.act1.selectedIndex=0;
	s.act1.options[0]=new Option("請選擇場所","");
	if(num=="1") {	s.act1.options[ctr]=new Option("中央平原","1");ctr=ctr+1;}
	if(num=="1") {	s.act1.options[ctr]=new Option("黑暗沼澤","3");ctr=ctr+1;}
	if(num=="1") {	s.act1.options[ctr]=new Option("王者之路","7");ctr=ctr+1;}
	if(num=="1") {	s.act1.options[ctr]=new Option("水晶之間","13");ctr=ctr+1;}	
	if(num=="2") {	s.act1.options[ctr]=new Option("試鍊洞窟","2");ctr=ctr+1;}
	if(num=="2") {	s.act1.options[ctr]=new Option("幻獸森林","8");ctr=ctr+1;}
	if(num=="2") {	s.act1.options[ctr]=new Option("天空之城","12");ctr=ctr+1;}	
	if(num=="2") {	s.act1.options[ctr]=new Option("最果之島","15");ctr=ctr+1;}	
	if(num=="3") {	s.act1.options[ctr]=new Option("迷霧森林","4");ctr=ctr+1;}
	if(num=="3") {	s.act1.options[ctr]=new Option("無淵洞窟","11");ctr=ctr+1;}
	if(num=="3") {	s.act1.options[ctr]=new Option("星河異界","9");ctr=ctr+1;}
	if(num=="4") {	s.act1.options[ctr]=new Option("灼熱荒漠","10");ctr=ctr+1;}
	if(num=="4") {	s.act1.options[ctr]=new Option("古代遺跡","5");ctr=ctr+1;}
	if(num=="4") {	s.act1.options[ctr]=new Option("久遠戰場","6");ctr=ctr+1;}
	if(num=="4") {	s.act1.options[ctr]=new Option("失落古船","14");ctr=ctr+1;}
	if(num=="5") {	s.act1.options[ctr]=new Option("魂魄之路","16");ctr=ctr+1;}
	if(num=="5") {	s.act1.options[ctr]=new Option("黑暗魔門","17");ctr=ctr+1;}
	if(num=="5") {	s.act1.options[ctr]=new Option("屍骨魔殿","18");ctr=ctr+1;}
	if(num=="5") {	s.act1.options[ctr]=new Option("真血之城","19");ctr=ctr+1;}
	if(num=="6") {	s.act1.options[ctr]=new Option("卡通裂縫","20");ctr=ctr+1;}
	if(num=="6") {	s.act1.options[ctr]=new Option("三國戰曲","21");ctr=ctr+1;}
	if(num=="6") {	s.act1.options[ctr]=new Option("無名國都","27");ctr=ctr+1;}
	if(num=="6") {	s.act1.options[ctr]=new Option("戰國世界","22");ctr=ctr+1;}
	if(num=="6") {	s.act1.options[ctr]=new Option("幻影魔流","23");ctr=ctr+1;}
	if(num=="7") {	s.act1.options[ctr]=new Option("黑道戰場","25");ctr=ctr+1;}
	if(num=="7") {	s.act1.options[ctr]=new Option("水滸樂園","29");ctr=ctr+1;}
	if(num=="7") {	s.act1.options[ctr]=new Option("精靈墓地","26");ctr=ctr+1;}
	if(num=="7") {	s.act1.options[ctr]=new Option("龍族墓地","31");ctr=ctr+1;}
	if(num=="8") {	s.act1.options[ctr]=new Option("虛界皇朝","28");ctr=ctr+1;}
	if(num=="8") {	s.act1.options[ctr]=new Option("虛念之界","30");ctr=ctr+1;}
	if(num=="8") {	s.act1.options[ctr]=new Option("虛幻迷宮","32");ctr=ctr+1;}
	if(num=="9") {	s.act1.options[ctr]=new Option("採礦區","24");ctr=ctr+1;}
	if(ctr==0)
	{
		ctr=1;
	}
	s.act1.length=ctr;
	s.act1.options[0].selected=true;
}
function ad_view(x)
{
	var f=parent.wog_view.document;
	message_cls();
	var temp_country='<select name="act_area" onChange="parent.change_mission(0,this.form);parent.select_area(this.options[this.options.selectedIndex].value,this.form)"><option value="" SELECTED>選擇場所</option><option value="1">中央大陸</option><option value="2">魔法王國</option><option value="3">熱帶雨林</option><option value="4">末日王城</option><option value="5">真魔王國</option><option value="6">時間鎖鏈</option><option value="7">五行三界</option><option value="8">迷失世界</option><option value="9">特殊地區</option></select>';
	f.write('<form name=f1>');
	f.write('<table width="95%" height="70%" border="1" cellspacing="0" cellpadding="2" align="center" bordercolor="#4B689E"><tr><td>');
	f.write('<table width="100%" border="0" cellspacing="0" cellpadding="2" align="center" bordercolor="#4B689E">');
	f.write('<tr><td>'+hr1+'</td></tr>');
	f.write('<tr><td><input type="radio" name="a_type" value="1" checked>冒險修行：'+temp_country);
	f.write(' <select name="act1" onChange="parent.change_mission(0,this.form)"><option value="" SELECTED>選擇場所</option></select></td></tr>');
	f.write('<tr><td><input type="radio" name="a_type" value="2">挑戰冠軍　<input type="radio" name="a_type" value="3">ＰＫ挑戰　<input type="radio" name="a_type" value="4">攻打領土(需加入公會)</td></tr>');
	f.write('<tr><td>'+hr1+'</td></tr>');
	f.write('<tr><td>戰鬥回合數 <input type="text" name="f_count" value="40" size="3" maxlength="3"> (最大'+f_count+')</td></tr>');
	f.write('<tr><td>ＨＰ低於 <input type="text" name="f_hp" value="15" size="3" maxlength="2"> ％自動使用HP恢復劑</td></tr>');
	f.write('<tr><td><input type="radio" name="a_mode" value="1" checked>快速模式　<input type="radio" name="a_mode" value="2" >一般模式</td></tr>');
	f.write('<tr><td>必殺技名稱 <input type="text" name="sat_name" size="30" maxlength="60" value="'+p_sat_name+'"></td></tr>');
	f.write('</td></tr>');
	f.write('<tr><td>'+hr1+'</td></tr>');
	f.write('<tr><td>');
	f.write('<tr><td><img src="'+pic+'c1.gif" align="middle"><input type="radio" name="f_mode" value="1">物理攻擊　<img src="'+pic+'c2.gif" align="middle"><input type="radio" name="f_mode" value="2" >魔法攻擊</td></tr>');
	f.write('<tr><td>'+hr1+'</td></tr><tr><td>');
	if(!x)
	{
		f.write('<input type="button" value="提 交 設 定" onClick="parent.datechk(document.forms[0])">');
	}else
	{
		f.write('<input type="button" value="開 始 戰 鬥" onClick="parent.datechk(document.forms[0],\'0\')">');
	}
	f.write('</td></tr>'+temp_tebla2+'</td></tr>'+temp_tebla2);
	f.write('</form>');
	f.write(temp_tebla2);
	var temp_s=Gookie("wog_fight");
	if(temp_s!=null)
	{
		var s1=temp_s.split(",");
		f.write('<script>');
		switch(s1[0])
		{
			case '0':
				f.write('document.forms[0].a_type[0].checked=true;parent.select_area("'+s1[3]+'",document.forms[0]);document.forms[0].act_area.value='+s1[3]+';document.forms[0].act1.value='+s1[1]+';');
			break;
			case '1':
				f.write('document.forms[0].a_type[1].checked=true;');
			break;
			case '2':
				f.write('document.forms[0].a_type[2].checked=true;');
			break;
			case '3':
				f.write('document.forms[0].a_type[3].checked=true;');
			break;
		}
		if(s1[2]==1)
		{
			f.write('document.forms[0].a_mode[0].checked=true;document.forms[0].a_mode[1].checked=false;');
		}else
		{
			f.write('document.forms[0].a_mode[1].checked=true;document.forms[0].a_mode[0].checked=false;');
		}
		if(s1[4]==1)
		{
			f.write('document.forms[0].f_mode[0].checked=true;document.forms[0].f_mode[1].checked=false;');
		}else
		{
			f.write('document.forms[0].f_mode[1].checked=true;document.forms[0].f_mode[0].checked=false;');
		}
		f.write('document.f1.f_count.value='+s1[5]+';');
		f.write('document.f1.f_hp.value='+s1[6]+';');
		f.write('</script>');
	}
}
function fire_date(p_at,p_df,p_mat,p_mdf,p_agl,p_hp,p_hpmax,p_s,p_img_set,i_img,m_at,m_df,m_mat,m_mdf,m_agl,m_hp,m_hpmax,m_s,m_name,m_img,f_status) 
{ 
	var f=parent.wog_view.document; 
	var p_name=get_name(); 
	temp_p_hp=p_hp; 
	temp_p_hpmax=p_hpmax; 
	temp_m_hp=m_hp; 
	temp_m_hpmax=m_hpmax; 
	var temp_php_img=(temp_p_hp/temp_p_hpmax)*150; 
	var temp_mhp_img=(temp_m_hp/temp_m_hpmax)*150; 
	var temp_php2_img=150-temp_php_img; 
	var temp_mhp2_img=150-temp_mhp_img; 
	var p_img=""; 
	setup_mname(m_name); 
	message_cls(); 
	p_s=s_status(p_s); 
	m_s=s_status(m_s); 
	if(m_img=="")
	{
		m_img="no_img.jpg"; 
	} 
	if(f_status==1)
	{
		if(m_img.indexOf("http") == -1)
		{
			m_img=img+m_img+".gif";
		}		
	}else
	{
		m_img=mimg+m_img;
	}
	if(p_img_set==1) 
	{ 
		p_img=i_img; 
	}else 
	{ 
		p_img=img+i_img+".gif"; 
	} 
	load_img(p_img,150,150);
	p_img='<img id=g1 src="'+p_img+'" height='+height+' width='+width+' border=0 style="position:absolute;left:25%;top:180;Z-INDEX:1;visibility:visible;">';
	load_img(m_img,150,150);
	m_img='<img id=g2 src="'+m_img+'" height='+height+' width='+width+' border=0 style="position:absolute;left:61%;top:180;Z-INDEX:1;visibility:visible;">';
	f.write(fight_temp_tebla1+'<tr><td colspan="2">'+p_name+'('+p_s+')</td><td colspan="2" >'+m_name+'('+m_s+')</td></tr>'); 
	f.write('<tr><td width="25%">HP</td><td class=b1 width="25%"><img src='+img+'bar/bhg.gif border="0" width="'+temp_php_img+'" id="p_img" name="p_img" height="13"><img src='+img+'bar/img_backing.gif border="0" width="'+temp_php2_img+'" id="p_img2" name="p_img2" height="13"></td><td width="25%">HP</td><td class=b1 width="25%"><img src='+img+'bar/bhg.gif border="0" width="'+temp_mhp_img+'" id="m_img" name="m_img" height="13"><img src='+img+'bar/img_backing.gif border="0" width="'+temp_mhp2_img+'" id="m_img2" name="m_img2" height="13"></td></tr>'); 
	f.write('<tr><td>物理攻擊</td><td>'+p_at+'</td><td>物理攻擊</td><td>'+m_at+'</td></tr>'); 
	f.write('<tr><td>物理防禦</td><td>'+p_df+'</td><td>物理防禦</td><td>'+m_df+'</td></tr>');    
	f.write('<tr><td>魔法攻擊</td><td>'+p_mat+'</td><td>魔法攻擊</td><td>'+m_mat+'</td></tr>');    
	f.write('<tr><td>魔法防禦</td><td>'+p_mdf+'</td><td>魔法防禦</td><td>'+m_mdf+'</td></tr>');    
	f.write('<tr><td>速度</td><td>'+p_agl+'</td><td>速度</td><td>'+m_agl+'</td></tr>');    
	f.write(temp_tebla2); 
	f.write('<table width="90%" border="0" cellspacing="0" cellpadding="0" align="center" >'); 
	f.write('<tr><td width="45%" height="180" align="center">'+p_img+'</td><td width="45%" height="180" align="center">'+m_img+'</td></tr>'); 
	f.write(temp_tebla2); 
	
	f.write('<table width="90%" border="0" cellspacing="0" cellpadding="0" align="center" ><tr><td><b>－ 戰 鬥 開 始 －</b></td></tr><tr><td colspan="2" align="center">'+hr+'<div align="center" id="a1"></td></tr>'); 
	f.write(temp_tebla2); 
	f.write('<img id=g3 border="0" style="position: absolute;left: 25%;top: 220;Z-INDEX: 1;visibility: hidden">');    
	if(p_support_name!="") 
	{ 
		f.write('<img id=g4 src="'+img+p_support_img+'.gif" border="0" style="position: absolute;left: 25%;top: 220;Z-INDEX: 1;visibility: hidden">');    
	}    
} 
function set_fight(temp_fightrow)
{
	fightrow=temp_fightrow;
	parent.show_fightrow();
}
function show_fightrow()
{
	var f=parent.wog_view.document;
	if(fight_num==0)
	{
		f.getElementById("a1").innerHTML=fightrow[fight_num];
	}else
	{
		eval(fightrow[fight_num]);
	}
	fight_num++;
	if(fight_num <= fightrow.length)
	{
		window.setTimeout("show_fightrow()",1000);
	}else
	{
		fight_num=0;
	}
	parent.wog_view.scroll(0,f.body.scrollHeight); 
}
function pact_date(temp_d,s,ss,support) 
{ 
	var f=parent.wog_view.document; 
	temp_m_hp=temp_m_hp-temp_d; 
	
	if(temp_m_hp<0){temp_m_hp=0;} 
	var temp_mhp_img=Math.round((temp_m_hp/temp_m_hpmax)*150); 
	var temp_mhp2_img=150-temp_mhp_img; 
	f.getElementById("m_img").width=temp_mhp_img; 
	f.getElementById("m_img").alt=temp_m_hp+"/"+temp_m_hpmax; 
	f.getElementById("m_img2").width=temp_mhp2_img; 
	f.getElementById("m_img2").alt=temp_m_hp+"/"+temp_m_hpmax;    
  
	if(support==0) 
	{ 
		f.getElementById("g1").style.visibility="visible"; 
		if(f.getElementById("g3")!=null) 
		{ 
			f.getElementById("g3").style.visibility="hidden"; 
		}       
		if(f.getElementById("g4")!=null) 
		{ 
			f.getElementById("g4").style.visibility="hidden"; 
		} 
		view_fight(temp_d,s,ss,p_name,m_name); 
	}else 
	{ 
		f.getElementById("g1").style.visibility="hidden"; 
		f.getElementById("g3").style.visibility="hidden"; 
		f.getElementById("g4").style.visibility="visible"; 
		view_fight(temp_d,s,ss,p_support_name,m_name); 
	} 
	gf=f.getElementById("g2").style.left; 
	gf=gf.replace("%",""); 
	gt=f.getElementById("g2").style.top; 
	shock_num=0; 
	temp_obj=f.getElementById("g2").style; 
	shock_s=s; 
	shock_fight(); 
} 
function mact_date(temp_d,s,ss) 
{    
	var f=parent.wog_view.document; 
	temp_p_hp=temp_p_hp-temp_d; 
 	  if(temp_p_hp<0){temp_p_hp=0;} 
	var temp_php_img=(temp_p_hp/temp_p_hpmax)*150; 
	var temp_php2_img=150-temp_php_img; 
    
	f.getElementById("p_img").width=temp_php_img; 
	f.getElementById("p_img").alt=temp_p_hp+"/"+temp_p_hpmax; 
	f.getElementById("p_img2").width=temp_php2_img; 
	f.getElementById("p_img2").alt=temp_p_hp+"/"+temp_p_hpmax; 
    
	view_fight(temp_d,s,ss,m_name,p_name);    
	gf=f.getElementById("g1").style.left; 
	gf=gf.replace("%",""); 
	gt=f.getElementById("g1").style.top; 
	shock_num=0; 
	temp_obj=f.getElementById("g1").style; 
	shock_s=s; 
	shock_fight(); 
} 
function pet_act_date(temp_d,s,pet_img) 
{	
	var f=parent.wog_view.document;
	if(pet_img!="" && f.getElementById("g3").src=="")
	{
		f.getElementById("g3").src=mimg+pet_img;
	}else if(pet_img=="" && f.getElementById("g3").src=="")
	{
		f.getElementById("g3").src=mimg+"no_img.jpg";	
	}
	f.getElementById("g1").style.visibility="hidden";
	if(f.getElementById("g3")!=null)
	{
		f.getElementById("g3").style.visibility="visible";
	}
	if(f.getElementById("g4")!=null)
	{
		f.getElementById("g4").style.visibility="hidden";
	}
	temp_m_hp=temp_m_hp-temp_d;
	if(temp_m_hp<0){temp_m_hp=0;}
	var temp_mhp_img=(temp_m_hp/temp_m_hpmax)*150;
	f.getElementById("m_img").width=temp_mhp_img;
	f.getElementById("m_img").alt=temp_m_hp+"/"+temp_m_hpmax;
	view_fight(temp_d,s,"",pet_pname,m_name);
	gf=f.getElementById("g2").style.left;
	gf=gf.replace("%","");
	gt=f.getElementById("g2").style.top;
	shock_num=0;
	temp_obj=f.getElementById("g2").style;
	shock_s=s;
	shock_fight();
}
function pet_def_date(temp_d,s,pet_img,ss)
{	
	var f=parent.wog_view.document;
	if(pet_img!="" && f.getElementById("g3").src=="")
	{
		f.getElementById("g3").src=mimg+pet_img;
	}else if(pet_img=="" && f.getElementById("g3").src=="")
	{
		f.getElementById("g3").src=mimg+"no_img.jpg";	
	}
	f.getElementById("g1").style.visibility="hidden";
	f.getElementById("g3").style.visibility="visible";
	view_fight(temp_d,s,ss,m_name,pet_pname);
	gf=f.getElementById("g3").style.left;
	gf=gf.replace("%","");
	gt=f.getElementById("g3").style.top;
	shock_num=0;
	temp_obj=f.getElementById("g3").style;
	if(ss=="1")
	{
		f.getElementById("a1").innerHTML="<font color=#89C7F3>"+pet_pname+"</font> 戰敗";
	}
	shock_s=s;
	shock_fight();
}
function shock_fight()
{
	var shock_ss=1;
	if(shock_s!="")
	{
		shock_ss=3;
	}
	temp_obj.left=(parseInt(gf)+(Math.floor(Math.random()*3*shock_ss)))+"%";
	temp_obj.top=(parseInt(gt)+(Math.floor(Math.random()*10*shock_ss)));
	shock_num++;
	if(shock_num<15)
	{
		window.setTimeout("shock_fight()",30);
	}else
	{
		temp_obj.left=gf+"%";
		temp_obj.top=gt;
	}
}
function view_fight(temp_d,s,ss,f,d)
{
	var fv=parent.wog_view.document;
	temp_d=' <font color=red><b>'+temp_d+'<b></font>';
	(f==p_name)?f='<font color="#89C7F3">'+f+'</font>':f='<font color="#81D8A8">'+f+'</font>';
	(d==p_name)?d='<font color="#89C7F3">'+d+'</font>':d='<font color="#81D8A8">'+d+'</font>';
	if(ss!="")
	{
		ss='<img src="'+img+'ss.gif" border="0">';
	}
	if(s!="")
	{	
		fv.getElementById("a1").innerHTML=ss+f+' 發動 <b><font color="#FF0000" size="+2">'+s+'</b></font> 給予 '+d+temp_d+' 點傷害';
	}else
	{	
		fv.getElementById("a1").innerHTML=ss+f+' 給予 '+d+temp_d+' 傷害';
	}
}
function miss_date(f,d)
{	
	var fv=parent.wog_view.document;
	(f==p_name)?f='<font color="#89C7F3">'+f+'</font>':f='<font color="#81D8A8">'+f+'</font>';
	(d==p_name)?d='<font color="#89C7F3">'+d+'</font>':d='<font color="#81D8A8">'+d+'</font>';
	fv.getElementById("a1").innerHTML=f+' 展開攻擊 '+d+' 快速閃開攻擊';
}
function end_date(s,en,getexp,getmoney,p_hp,state,n,i,d_item_num)
{	
	var f=parent.wog_view.document;
	var enstr="";
	if(en=="0") 
   	{ 
      		enstr="戰敗了!!!"; 
      		parent.wog_log_save(s+' 在與 '+m_name+' 的戰鬥中戰敗 經驗值：'+getexp+' 金錢：'+getmoney); 
   	}else if(en=="1") 
   	{ 
     		enstr="獲得了勝利！！"; 
      		parent.wog_log_save(s+' 在與 '+m_name+' 的戰鬥中獲勝 經驗值：'+getexp+' 金錢：'+getmoney); 
   	}
	f.write(hr);
	f.write(fight_temp_tebla1+'<tr><td ><b>'+s+' '+enstr+'</b></td></tr>');
	f.write('<tr><td>HP剩下 <b>'+p_hp+'</b> , 獲得經驗值 <b>'+getexp+'</b> , 獲得金錢 <b>'+getmoney+'</b></td></tr>');
	if(d_item_num > 0 && i=="1")
	{
		var s_num=d_item_name.lastIndexOf("*");
		if (s_num > -1){
			d_item_name=d_item_name.substr(0,s_num)+"*"+d_item_num+'</a>';
		}else{
			d_item_name+="*"+d_item_num+'</a>';
		}
		f.write('<tr><td><b>剩餘 '+d_item_name+'</b></td></tr>');
	}
	if(n=="1"){
		f.write('<tr><td>狀態 <b>'+state+'</b> 消失</td></tr>');
		parent.wog_log_save('狀態 <b>'+state+'</b> 消失'); 
	}
	f.write(temp_tebla2);
}
function get_item(i,s,bag)
{	
	var f=parent.wog_view.document;
	var enstr="";
	if(s==0)
	{
		enstr="裝備欄超過 "+bag+" 物品無法拾獲"; 
      		parent.wog_log_save('裝備欄已滿 '+bag+' 種物品，無法拾獲 '+i); 
	}else if(s==1)
	{
		enstr="打鬥中幸運取得寶物";
		parent.wog_log_save('戰鬥中取得寶物：'+i);
	}
	f.write(fight_temp_tebla1+'<br><tr><td ><b>'+enstr+' '+i+'</b></td></tr>');
	f.write(temp_tebla2);
	parent.wog_view.scroll(0,f.body.scrollHeight); 
}
function fight_event(s,temp_d)
{
	var f=parent.wog_view.document;	
	temp_p_hp=parseInt(temp_p_hp)+parseInt(temp_d);
	if(temp_p_hp>temp_p_hpmax)
	{
		temp_p_hp=temp_p_hpmax;
	}
	var temp_php_img=(temp_p_hp/temp_p_hpmax)*150;
	f.getElementById("p_img").width=temp_php_img;
	f.getElementById("p_img").alt=temp_p_hp+"/"+temp_p_hpmax;
	f.write(hr);
	//f.write(fight_temp_tebla1+'<tr><td ><b>'+p_name+' 使用 '+s+'</b></td></tr>');
	//f.write(temp_tebla2+'<br>');
	fight_message="";
	fight_message+=fight_temp_tebla1+'<tr><td ><b>'+p_name+' 使用 '+s+'</b></td></tr>'+temp_tebla2+'<br>';
	f.getElementById("a1").innerHTML=fight_message;	
}
function lv_up(str,agl,smart,life,vit,au,be,count,up_type)
{
	var f=parent.wog_view.document;
	if(up_type==null)
	{
		f.write(hr);
		f.write(fight_temp_tebla1);
		f.write('<br><tr><td colspan="10"><b>'+p_name+' 等級上升</b></td></tr>');
		f.write('<tr><td><b>力量</b></td>');
		f.write('<td><b>速度</b></td>');
		f.write('<td><b>智力</b></td>');
		f.write('<td><b>生命</b></td>');
		f.write('<td><b>體質</b></td>');
		f.write('<td><b>魅力</b></td>');
		f.write('<td><b>信仰</b></td>');
		//f.write('<td><b>潛能</b></td></tr>');
		f.write('<tr><td><b>↑ '+str+'</b></td>');
		f.write('<td><b>↑ '+agl+'</b></td>');
		f.write('<td><b>↑ '+smart+'</b></td>');
		f.write('<td><b>↑ '+life+'</b></td>');
		f.write('<td><b>↑ '+vit+'</b></td>');
		f.write('<td><b>↑ '+au+'</b></td>');
		f.write('<td><b>↑ '+be+'</b></td>');
		//f.write('<td><b>↑ '+count+'</b></td></tr>');
		f.write(temp_tebla2);
		parent.wog_log_save('經過一番努力 '+p_name+' 等級上升了<br>力量上升 '+str+'，速度上升 '+agl+'，智力上升 '+smart+'<br>生命上升 '+life+'，體質上升 '+vit+'，魅力上升 '+au+'，信仰上升 '+be);
		//parent.wog_log_save('經過一番努力 '+p_name+' 等級上升了<br>力量上升 '+str+'，速度上升 '+agl+'，智力上升 '+smart+'，潛能增加 '+count+'<br>生命上升 '+life+'，體質上升 '+vit+'，魅力上升 '+au+'，信仰上升 '+be);
	}
}
function lv_up2(str,agl,smart,life,vit,au,be,luck,p_exp,count)
{
	var f=parent.wog_view.document;
	if(p_exp!=null)
	{
		message_cls();
		f.write(temp_tebla1+'<br><tr><td class="b1"><b>'+p_name+' 能力上升 </b></td></tr>');
	}
	f.write('<tr><td class="b1"><b>力量上升 '+str+'</b></td></tr>');
	f.write('<tr><td class="b1"><b>速度上升 '+agl+'</b></td></tr>');
	f.write('<tr><td class="b1"><b>智力上升 '+smart+'</b></td></tr>');
	f.write('<tr><td class="b1"><b>生命上升 '+life+'</b></td></tr>');
	f.write('<tr><td class="b1"><b>體質上升 '+vit+'</b></td></tr>');
	f.write('<tr><td class="b1"><b>魅力上升 '+au+'</b></td></tr>');
	f.write('<tr><td class="b1"><b>信仰上升 '+be+'</b></td></tr>');
	if(luck!=null)
	{
		f.write('<tr><td class="b1"><b>運氣上升 '+luck+' （玩家運氣高達1000，服食包果將沒有效果）</b></td></tr>');
	}
	if(count!=null)
	{
		f.write('<tr><td class="b1"><b>潛能增加 '+count+' 點</b></td></tr>');
	}	
	if(p_exp!=null)
	{
		f.write('<tr><td class="b1"><b>經驗值上升 '+p_exp+'</b></td></tr>');
	}
	f.write(temp_tebla2);
}
function bag_up(str)
{
	var f=parent.wog_view.document;
	message_cls();
	f.write(temp_tebla1+'<tr><td class="b1"><b>道具欄增加 '+str+' 格</b></td></tr>');
	f.write(temp_tebla2);
	parent.wog_log_save('道具欄增加 '+str+' 格');
}
function bagx_up(str)
{
	var f=parent.wog_view.document;
	message_cls();
	f.write(temp_tebla1+'<tr><td class="b1"><b>更換智能'+str+'包後 裝備欄空間變成 '+(20+str)+' 格了</b></td></tr>');
	f.write(temp_tebla2);
	parent.wog_log_save('更換智能'+str+'包後，裝備欄空間變成 '+(20+str)+' 格了');
}
function cont_fight(lv,p_id,win,s)
{	
	var f=parent.wog_view.document;
	f.write(hr);
	f.write(temp_tebla1);
	f.write('<form action="wog_fight.php" method="post" target="mission">');
	f.write('<tr><td>挑戰等級 LV'+lv+' <input type="submit" value="挑戰下一位">(對戰間隔時間8秒鐘)</td></tr>');
	f.write('<input type="hidden" name="f" value="fire">');
	f.write('<input type="hidden" name="act" value="22">');
	f.write('<input type="hidden" name="at_type" value="'+s+'">');
	f.write('<input type="hidden" name="p_id" value="'+p_id+'">');
	f.write('<input type="hidden" name="p_lv" value="'+lv+'">');
	f.write('<input type="hidden" name="win" value="'+win+'">');
	f.write('<input type="hidden" name="temp_id" value="1">');
//	f.write('<input type="hidden" name="sat_name" value="'+p_sat_name+'">');
	f.write('</form>');
	f.write(temp_tebla2);
}
function cp_end(p_name)
{
	var f=parent.wog_view.document;
	f.write(temp_tebla1);
	f.write('<br><tr><td  >'+p_name+' 順利當上冠軍 </td></tr>')
	f.write(temp_tebla2);
	parent.wog_log_save('順利成為冠軍');
}
//##### shop begin #####
function select_store()
{
	message_cls();
	var f=parent.wog_view.document;
	f.write('<form action="wog_act.php" method="post" target="mission" name="f1" >');
	f.write(temp_tebla1);
	f.write('<tr><td><img src='+img+'shop/sword.jpg><br>裝備商店</td><td><input type="button" value="一級裝備" onClick="parent.th_submit(document.f1,1,0)">&nbsp;<input type="button" value="二級裝備" onClick="parent.th_submit(document.f1,2,0)">&nbsp;<input type="button" value="三級裝備" onClick="parent.th_submit(document.f1,3,0)">&nbsp;<input type="button" value="四級裝備" onClick="parent.th_submit(document.f1,4,0)">&nbsp;<input type="button" value="五級裝備" onClick="parent.th_submit(document.f1,5,0)">&nbsp;<input type="button" value="六級裝備" onClick="parent.th_submit(document.f1,6,0)">&nbsp;<input type="button" value="七級裝備" onClick="parent.th_submit(document.f1,7,0)"></td>');
	f.write('<tr><td><img src='+img+'shop/car.jpg><br>座騎莊園</td><td><input type="button" value="神速座騎" onClick="parent.th_submit(document.f1,1,7)">&nbsp;<input type="button" value="物攻座騎" onClick="parent.th_submit(document.f1,2,7)">&nbsp;<input type="button" value="物防座騎" onClick="parent.th_submit(document.f1,3,7)">&nbsp;<input type="button" value="魔攻座騎" onClick="parent.th_submit(document.f1,4,7)">&nbsp;<input type="button" value="魔防座騎" onClick="parent.th_submit(document.f1,5,7)"></td>');
	f.write('<tr><td><img src='+img+'shop/ride.jpg><br>特別商店</td><td>&nbsp;<input type="button" value="精靈商店" onClick="parent.th_submit(document.f1,1,8)">&nbsp;<input type="button" value="神奇道具" onClick="parent.th_submit(document.f1,1,5)">&nbsp;<input type="button" value="優之良品" onClick="parent.th_submit(document.f1,1,6)"></td>');
	f.write('<tr><td><img src='+img+'shop/item.jpg><br>服務商店</td><td><input type="button" value="手術中心" onClick=parent.black_shop()>&nbsp;<input type="button" value="復活時空" onClick=if(confirm("復活會減少經驗值1/5，確定是否復活")){parent.act_click(\'chara\',\'revive\')}>&nbsp;<input type="button" value="寵物牧場" name="ats2" onClick="parent.act_click(\'pet\',\'index\')">&nbsp;<input type="button" value="更換頭銜" onClick="parent.act_click(\'count\',\'rechat_confirm\')">&nbsp;<input type="button" value="緣份郵局" onClick="parent.message()"></td>');
	f.write('<tr><td><img src='+img+'shop/other.jpg><br>修行地帶</td><td><input type="button" value="轉生輪迴" onClick=parent.act_click(\'rebirth\',\'rebirth_confirm\')>&nbsp;<input type="button" value="減少戰敗" onClick=if(confirm("一次收費五百萬，減一百敗場，確定是否減敗數")){parent.act_click(\'chara\',\'dlo\')}>&nbsp;<input type="button" value="減少被殺" onClick=if(confirm("一次收費一千萬，減十PK敗場，確定是否減敗數")){parent.act_click(\'chara\',\'dfa\')}>&nbsp;<input type="button" value="修復時間" onClick=if(confirm("一次收費五億，修復等待時間，確定是否修復")){parent.act_click(\'chara\',\'ati\')}>&nbsp;<input type="button" value="轉運摩天輪" onClick="parent.reluck()"></td>');
	f.write(temp_tebla2);
	f.write('<input type="hidden" name="f" value="shop">');
	f.write('<input type="hidden" name="act" value="view">');
	f.write('<input type="hidden" name="temp_id" value="">');
	f.write('<input type="hidden" name="temp_id2" value="">');
	f.write('</form>');
}
function shop_home_view(s,a,temp_id,ss,temp_id2,df_total,page)
{
	message_cls();
	var f=parent.wog_view.document;
	f.write(temp_tebla1);
	f.write('<form action="wog_act.php" method="post" name="f1" target="mission">');
	if(temp_id2<=7 && temp_id<5){
	f.write('<tr><td colspan=5 bgcolor="#4B689E"><b>第 '+temp_id2+' 級裝備</b></td></tr>');
	f.write('<tr>');
	f.write('<td '+(temp_id=='0'?'bgcolor="#3366FF"':'onmouseover="this.style.color=\'#3366FF\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,'+temp_id2+',0)"')+'>武器裝備</td>');
	f.write('<td '+(temp_id=='1'?'bgcolor="#3366FF"':'onmouseover="this.style.color=\'#3366FF\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,'+temp_id2+',1)"')+'>頭部裝備</td>');
	f.write('<td '+(temp_id=='2'?'bgcolor="#3366FF"':'onmouseover="this.style.color=\'#3366FF\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,'+temp_id2+',2)"')+'>身體裝備</td>');
	f.write('<td '+(temp_id=='3'?'bgcolor="#3366FF"':'onmouseover="this.style.color=\'#3366FF\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,'+temp_id2+',3)"')+'>手部裝備</td>');
	f.write('<td '+(temp_id=='4'?'bgcolor="#3366FF"':'onmouseover="this.style.color=\'#3366FF\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,'+temp_id2+',4)"')+'>腳部裝備</td>');
	}
	if(temp_id==5){
	f.write('<tr><td colspan=5 bgcolor="#4B689E"><b>道具中心</b></td></tr>');
	f.write('<tr>');
	f.write('<td '+(temp_id=='5'?'bgcolor="#3366FF"':'onmouseover="this.style.color=\'#3366FF\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,1,\'5\')"')+'>道具小屋</td>');
	f.write('<td '+(temp_id=='6'?'bgcolor="#3366FF"':'onmouseover="this.style.color=\'#3366FF\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,1,\'6\')"')+'>優之良品</td>');
	}
	if(temp_id==6){
	f.write('<tr><td colspan=5 bgcolor="#4B689E"><b>道具中心</b></td></tr>');
	f.write('<tr>');
	f.write('<td '+(temp_id=='5'?'bgcolor="#3366FF"':'onmouseover="this.style.color=\'#3366FF\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,1,\'5\')"')+'>道具小屋</td>');
	f.write('<td '+(temp_id=='6'?'bgcolor="#3366FF"':'onmouseover="this.style.color=\'#3366FF\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,1,\'6\')"')+'>優之良品</td>');
	}
	if(temp_id==7){
	f.write('<tr><td colspan=5 bgcolor="#4B689E"><b>座騎莊園</b></td></tr>');
	f.write('<tr>');
	f.write('<td '+(temp_id2=='1'?'bgcolor="#3366FF"':'onmouseover="this.style.color=\'#3366FF\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,1,7)"')+'>神速座騎</td>');
	f.write('<td '+(temp_id2=='2'?'bgcolor="#3366FF"':'onmouseover="this.style.color=\'#3366FF\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,2,7)"')+'>物攻座騎</td>');
	f.write('<td '+(temp_id2=='3'?'bgcolor="#3366FF"':'onmouseover="this.style.color=\'#3366FF\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,3,7)"')+'>物防座騎</td>');
	f.write('<td '+(temp_id2=='4'?'bgcolor="#3366FF"':'onmouseover="this.style.color=\'#3366FF\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,4,7)"')+'>魔攻座騎</td>');
	f.write('<td '+(temp_id2=='5'?'bgcolor="#3366FF"':'onmouseover="this.style.color=\'#3366FF\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,5,7)"')+'>魔防座騎</td>');
	}
	if(temp_id==8){
	f.write('<tr><td colspan=5 bgcolor="#4B689E"><b>精靈世界</b></td></tr>');
	f.write('<tr>');
	f.write('<td '+(temp_id2=='1'?'bgcolor="#3366FF"':'onmouseover="this.style.color=\'#3366FF\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,1,8)"')+'>火屬性</td>');
	f.write('<td '+(temp_id2=='2'?'bgcolor="#3366FF"':'onmouseover="this.style.color=\'#3366FF\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,2,8)"')+'>水屬性</td>');
	f.write('<td '+(temp_id2=='3'?'bgcolor="#3366FF"':'onmouseover="this.style.color=\'#3366FF\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,3,8)"')+'>光屬性</td>');
	f.write('<td '+(temp_id2=='4'?'bgcolor="#3366FF"':'onmouseover="this.style.color=\'#3366FF\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,4,8)"')+'>暗屬性</td>');
	f.write('<td '+(temp_id2=='5'?'bgcolor="#3366FF"':'onmouseover="this.style.color=\'#3366FF\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,5,8)"')+'>風屬性</td>');
	}
	f.write('</tr>');
	if(temp_id<5)
	{
		f.write('<tr><td colspan="9">');
		for(var i=1;i<=7;i++)
		{
			f.write('<input type="button" value="LV '+i+'" class="b3" onClick="parent.th_submit(document.f1,'+i+',\''+temp_id+'\')" '+(i==temp_id2?'disabled':'')+'> ');
		}
		f.write('</td></tr>');
	}
	f.write('<input type="hidden" name="f" value="shop">');
	f.write('<input type="hidden" name="act" value="view">');
	f.write('<input type="hidden" name="temp_id" value="">');
	f.write('<input type="hidden" name="temp_id2" value="">');
	f.write('</form>');
	f.write(temp_tebla2);
	f.write('<form action="wog_act.php" method="post" name=pageform target="mission">');
	pagesplit(df_total,page);
	f.write('<input type="hidden" name="page" value="">');	
	f.write('<input type="hidden" name="f" value="shop">');	
	f.write('<input type="hidden" name="act" value="view">');
	f.write('<input type="hidden" name="temp_id" value="'+temp_id+'">');
	f.write('<input type="hidden" name="temp_id2" value="'+temp_id2+'">');
	f.write('</form>');
	f.write(temp_tebla1);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<tr bgcolor="#4B689E"><td>選擇</td><td>物攻擊力</td><td>魔攻擊力</td><td>物防禦力</td><td>魔防禦力</td><td>速度</td><td>運氣</td><td>職業</td><td>能力限制</td><td>名稱</td><td>價格</td></tr>');
	if(s!="")
	{
		var s1=s.split(";");
		for(var i=0;i<s1.length;i++)
		{
			var s2=s1[i].split(",");
			var mlv="";
			var seeatt="";
			if(s2[13]!=0){mlv="("+s2[13]+"LV)";}
			if(s2[13]=="0"){s2[13]="";}
			if(s2[14].length>0){
			while(s2[14].indexOf("&n") > 0) 
			{ 
			s2[14]=s2[14].replace("&n","\r\n"); 
			}
			seeatt="<img src='"+img+"icon3.gif' alt='"+s2[14]+"'>";
			}
			f.write('<tr onMouseOver="this.style.backgroundColor=\'#0000CD\'" onMouseOut="this.style.backgroundColor=\'\'" onclick="parent.setRadioValue(\'adds\','+s2[0]+');" style="cursor:hand"><td ><input type="radio" name="adds" value="'+s2[0]+'"></td><td>'+s2[6]+'</td><td>'+s2[7]+'</td><td>'+s2[1]+'</td><td>'+s2[2]+'</td><td>'+s2[3]+'</td><td>'+s2[12]+'</td><td>'+s2[11]+'</td><td>力:'+s2[8]+' 速:'+s2[9]+' 智:'+s2[10]+' '+mlv+'</td><td><a href="javascript:parent.foot_turn(\'arm\',\'check_item\','+s2[0]+')">'+s2[5]+'</a>'+seeatt+'</td><td>'+s2[4]+'</td></tr>');
		}
	}else
	{
		f.write('<tr><td colspan="11" >沒有可以使用的裝具</td></tr>');	
	}
	var s1=ss.split(",");
	f.write('<tr bgcolor="#777779"><td ><font color="#FF0000">E</font></td><td>'+s1[4]+'</td><td>'+s1[5]+'</td><td>'+s1[0]+'</td><td>'+s1[1]+'</td><td>'+s1[2]+'</td><td>'+s1[6]+'</td><td>-----</td><td>-------</td><td><a href="javascript:parent.foot_turn(\'arm\',\'check_item\','+s1[8]+')">'+s1[3]+'</a></td><td>-------</td></tr>');
	if(temp_id==5 || temp_id==6){
	f.write('<tr><td colspan="11" >請選擇數量(1-99):<input type="text" name="buy_num" size="2" maxlength="2" value="1"></td></tr>');
	}else{
	f.write('<tr><td colspan="11" >請選擇數量(1-99):<input type="text" name="buy_num" size="2" maxlength="2" value="1" disabled="disabled"></td></tr>');
	}
	f.write('<tr><td colspan="11" ><input type="submit" value="確定購買"></td></tr>');
	f.write('<tr><td colspan="2" bgcolor="#4B689E">身上金額</td><td colspan="9" ><div id="show_message"> '+s1[7]+'</div></td></tr>');
	f.write(temp_tebla2);
	f.write('<input type="hidden" name="f" value="shop">');	
	f.write('<input type="hidden" name="act" value="buy">');
	f.write('<input type="hidden" name="temp_id" value="'+temp_id+'">');
	f.write('</form>');
	f.write('<span id="wog_message_box"></span>');
}
function black_shop()
{
	message_cls();
	var f=parent.wog_view.document;
	f.write(temp_tebla1);
	f.write('<tr><td>');
	f.write('<table width="100%" height="100%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#333333">');
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<input type="hidden" name="f" value="store">');	
	f.write('<input type="hidden" name="act" value="img">');
	f.write('<tr><td>變更角色圖像</td></tr>');
	f.write('<tr><td>輸入圖像編號 <input type="text" name="num" size="2"> <a href="javascript://" onClick="window.open(\'wog_etc.php?f=img\',\'\',\'menubar=no,status=no,scrollbars=yes,top=50,left=50,toolbar=no,width=400,height=400\')">圖像預覽</a></td></tr>');
	f.write('<tr><td><input type="submit" value="使用系統圖像 (50萬)"></td></tr>');
	f.write('</form>');
	f.write(temp_tebla2);
	f.write('</td><td>');
	f.write('<table width="100%" height="100%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#333333">');
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<input type="hidden" name="f" value="store">');	
	f.write('<input type="hidden" name="act" value="sex">');
	f.write('<tr><td>變更角色性別</td></tr>');
	f.write('<tr><td><input type="radio" name="num" value="1">男　<input type="radio" name="num" value="2">女</td></tr>');
	f.write('<tr><td><input type="submit" value="改變性別 (500萬)"></td></tr>');
	f.write('</form>');
	f.write(temp_tebla2);
	f.write('</td><td>');
	f.write('<table width="100%" height="100%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#333333">'); 
	f.write('<form action="wog_act.php" method="post" target="mission">'); 
	f.write('<input type="hidden" name="f" value="store">'); 
	f.write('<input type="hidden" name="act" value="s">'); 
	f.write('<tr><td>變更角色屬性</td></tr>'); 
	f.write('<tr><td><input type="radio" name="s" value="1">地　<input type="radio" name="s" value="2">水　<input type="radio" name="s" value="3">火　<input type="radio" name="s" value="4">木　<input type="radio" name="s" value="5">風　<input type="radio" name="s" value="6">毒</td></tr>');
	f.write('<tr><td><input type="submit" value="改變屬性 (100萬)"></td></tr>'); 
	f.write('</form>');
	f.write(temp_tebla2);  
	f.write('</td></tr>');
	f.write(temp_tebla2);
	f.write(hr);
	f.write(temp_tebla1);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<input type="hidden" name="f" value="store">');	
	f.write('<input type="hidden" name="act" value="img2">');
	f.write('<br><tr bgcolor="#4B689E"><td>自定角色圖像<br>(請勿使用過大的圖，最佳size請勿超過 120*120，禁止色情不雅圖片！)</td></tr>');
	f.write('<tr><td>輸入圖像連結 <input type="text" name="url" value="http://" size="45" maxlength="150"></td></tr>');
	f.write('<tr><td><input type="submit" value="使用自訂圖像 (50萬)"></td></tr>');
	f.write('</form>');
	f.write(temp_tebla2);
	f.write(hr); 
	f.write(temp_tebla1);
	f.write('<form action="wog_act.php" name="f3" method="post" target="mission">');
	f.write('<br><tr bgcolor="#4B689E"><td>變更推薦網址</td></tr>'); 
	f.write('<tr><td>輸入網頁名稱 <input type="text" name="site" size="20"></td></tr>'); 
	f.write('<tr><td>輸入網址連結 <input type="text" name="siteurl" value="http://" size="40" maxlength="150"></td></tr>'); 
	f.write('<tr><td><input type="button" value="改變推薦網址 (100萬)" onclick="parent.act_click(\'store\',\'url\',document.f3.site.value+\',\'+document.f3.siteurl.value)"></td></tr>'); 
	f.write('</form>');
	f.write(temp_tebla2); 
}
function sale_item(s,b)
{
	var temp_s="";
	if(s!=null)
	{
		if(s.length!=undefined)
		{
			for(var i=0;i<s.length;i++)
			{
				if(s[i].checked==true)
				{
					temp_s+=","+s[i].value;
				}			
			}
			temp_s=temp_s.substr(1,temp_s.length);
		}else
		{
			temp_s=s.value;
		}
	}
	var s1=temp_s.split(","); 
   message_cls(); 
   var f=parent.wog_view.document;
   f.write('<form action="wog_act.php" method="post" target="mission" name="f1">');
   f.write('<input type="hidden" name="item_id" value="'+s1[0]+'">'); 
   f.write('<input type="hidden" name="item_num" value="'+b+'">'); 
   f.write(temp_tebla1); 
   f.write('<tr><td colspan="4" bgcolor="#777779" width="50%">填寫拍賣資料</td></tr>');
   f.write('<tr><td bgcolor="#4B689E">拍賣商品</td><td>'+s1[1]+'*<FONT COLOR="yellow">'+b+'</FONT></td><td bgcolor="#4B689E">指定買家</td><td><input type="text" name="pay_id" size="20" value="" maxlength="13"></td></tr>');
   f.write('<tr><td bgcolor="#4B689E"><FONT COLOR="red"><b>*</b></FONT>開售價</td><td><input type="text" name="money" size="20" value="10" maxlength="13"></td><td bgcolor="#4B689E"><FONT COLOR="red"><b>*</b></FONT>拍賣天數</td><td><input type="text" name="day" size="20" value="1" maxlength="2"></td></tr>');
   f.write('<tr><td bgcolor="#4B689E">每口叫價</td><td><input type="text" name="b_money" size="20" value="0" maxlength="13"><td bgcolor="#4B689E">直接購買價</td><td><input type="text" name="f_money" size="20" value="0" maxlength="13"></td></tr>');
   f.write('<tr><td colspan="2">拍賣時間單位為時數，時間到期自動下架</td><td colspan="2">拍賣時間不可超過<b>１０</b>天</td></tr>');
   f.write('<tr><td colspan="2">送出後需繳交開售價的５％系統手續費</td><td colspan="2">拍賣中的裝備不可超過<b>５</b>件</td></tr>');
   f.write('<tr><td colspan="4">顯示<FONT COLOR="red"><b>*</b></FONT>的必須輸入，每口價和直購價輸入<b>0</b>及指定買家<b>留空</b>便會關閉此功能</td></tr>');
   
   f.write('<tr><td colspan="2"><input type="button" value="取 消 拍 賣" onclick="history.go(-1)"></td><td colspan="2"><input type="button" value="送　出　拍　賣" onclick="parent.foot_turn2(\'sale\',\'sale\',document.f1.item_id.value,document.f1.money.value,document.f1.day.value,document.f1.pay_id.value,document.f1.b_money.value,document.f1.f_money.value,document.f1.item_num.value)"></td></tr>');
   f.write(temp_tebla2); 
   f.write('</form>'); 
} 
function sale_view(saletotal,page,s,type,qkey)
{
	message_cls();
	var f=parent.wog_view.document;
	f.write('<form action="wog_etc.php" method="get" name="pageform" target="mission">');
	pagesplit(saletotal,page);
	f.write('<input type="hidden" name="page" value="1">');
	f.write('<input type="hidden" name="type" value="'+type+'">');
	f.write('<input type="hidden" name="f" value="sale">');	
	f.write('<input type="hidden" name="act" value="view">');
	f.write('<input type="hidden" name="qKey"  value="'+qkey+'">');
	f.write(temp_tebla1);
	f.write('<tr><td colspan="11" bgcolor="#4B689E">拍 賣 商 品</td></tr>');
	f.write('<tr><td colspan="11"><input type="button" value="武器" onclick="parent.sel_type(\'0\')" '+(type=='0'?'disabled':'')+'> <input type="button" value="頭部" onclick="parent.sel_type(\'1\')" '+(type=='1'?'disabled':'')+'> <input type="button" value="身體" onclick="parent.sel_type(\'2\')" '+(type=='2'?'disabled':'')+'> <input type="button" value="手套" onclick="parent.sel_type(\'3\')" '+(type=='3'?'disabled':'')+'> <input type="button" value="鞋子" onclick="parent.sel_type(\'4\')" '+(type=='4'?'disabled':'')+'> <input type="button" value="道具" onclick="parent.sel_type(\'5\')" '+(type=='5'?'disabled':'')+'> <input type="button" value="座騎" onclick="parent.sel_type(\'7\')" '+(type=='7'?'disabled':'')+'> <input type="button" value="精靈" onclick="parent.sel_type(\'8\')" '+(type=='8'?'disabled':'')+'> <input type="button" value="稱號" onclick="parent.sel_type(\'9\')" '+(type=='9'?'disabled':'')+'> <input type="button" value="符咒" onclick="parent.sel_type(\'10\')" '+(type=='10'?'disabled':'')+'> <input type="button" value="寵物" onclick="parent.sel_type(\'11\')" '+(type=='11'?'disabled':'')+'> <input type="button" value="檢索" onclick="top.wog_view.location.replace(\'wog_sale_search.htm\');"></td></tr>');
	f.write('</form>');
	f.write('<form action="wog_act.php" method="post" target="mission" name=f1>');
	if(type < 11)
	{	
		f.write('<tr><td>賣家</td><td>出價最高 / 指定買家</td><td>商品</td><td>原價</td><td>最新叫價</td><td>每口價</td><td>直購價</td><td>剩餘時間</td><td>選擇</td></tr>');
		if(s!="")
		{
			var s1=s.split(";");
			for(var i=0;i<s1.length;i++)
			{
				var s2=s1[i].split(",");
				var seeatt="";
				if(s2[18].length>0)
				{
					while(s2[18].indexOf("&n") > 0) 
					{ 
						s2[18]=s2[18].replace("&n","\r\n"); 
					}
					seeatt="<img src='"+img+"icon3.gif' alt='"+s2[18]+"'>";
				}
				if(s2[24]==1)
				{
					s2[15]="<font color=#BBBBBB>"+s2[15]+"</font>";
				}
				t=" 天內";
				if(s2[23]==1){
					t=" 小時內";
				}
				f.write('<tr onMouseOver="this.style.backgroundColor=\'#0000CD\'" onMouseOut="this.style.backgroundColor=\'\'" onclick="parent.setRadioValue(\'s_id\','+s2[11]+');" style="cursor:hand"><td>'+s2[0]+'</td><td>'+s2[15]+'</td><td><a href="javascript:parent.foot_turn(\'arm\',\'check_item\','+s2[22]+')">'+s2[1]+'</a>*'+s2[21]+seeatt+'</td><td>'+s2[10]+'</td><td>'+s2[12]+'</td><td>'+s2[16]+'</td><td>'+s2[14]+'</td><td>'+s2[13]+t+'</td><td><input type="radio" name="s_id" value="'+s2[11]+'"></td></tr>'); 
			}
		}
		f.write('<input type="hidden" name="stype" value="0">'); 
        f.write('<tr><td colspan="11">你的出價：<input class="text" name="buy_money" type="text" value="">　直接購買：<input name="f_buy" type="checkbox" value="1">　<input class="text" type="submit" value="競投">【灰色顯示指定買家】</td></tr>');
        }else
        {
        f.write('<tr><td>拍賣者</td><td>商品</td><td>AT</td><td>MT</td><td>DEF</td><td>個性</td><td>年紀</td><td>出擊值</td><td>金額</td><td>剩餘時間</td><td>選擇</td></tr>'); 
		if(s!="")
		{
			var s1=s.split(";");
			for(var i=0;i<s1.length;i++)
			{
				var s2=s1[i].split(",");
				var now_date=new Date();
				t=" 天內";
				if(s2[12]==1){
					t=" 小時內";
				}
				f.write('<tr onMouseOver="this.style.backgroundColor=\'#0000CD\'" onMouseOut="this.style.backgroundColor=\'\'" onclick="parent.setRadioValue(\'s_id\','+s2[1]+');" style="cursor:hand"><td>'+s2[0]+'</td><td>'+s2[2]+'-'+s2[3]+'</td><td>'+s2[4]+'</td><td>'+s2[5]+'</td><td>'+s2[6]+'</td><td>'+pet_type(s2[7])+'</td><td>'+s2[8]+'</td><td>'+s2[9]+'</td><td>'+s2[10]+'</td><td>'+s2[11]+t+'</td><td><input type="radio" name="s_id" value="'+s2[1]+'"></td></tr>');
			}
		}
	f.write('<input type="hidden" name="stype" value="1">');
	f.write('<tr><td colspan="11"><input type="submit" value="購買"></td></tr>');
    } 
	f.write('<input type="hidden" name="f" value="sale">'); 
	f.write('<input type="hidden" name="act" value="buy">'); 
	f.write('<input type="hidden" name="type" value="'+type+'">');
	f.write('</form>'); 
	f.write(temp_tebla2); 
	f.write('<span id="wog_message_box"></span>');
}
//收購區
function sale2_post()
{
	message_cls(); 
	var f=parent.wog_view.document; 
	f.write(temp_tebla1); 
	f.write('<form action="wog_act.php" method="post" target="mission" name="f1">');
	f.write('<tr><td colspan="4" bgcolor="#777779" width="50%">填寫收購資料</td></tr>');
	f.write('<tr><td>收購價格:</td><td><input type="text" name="money" value="" size="10" ></td><td>收購天數:</td><td><input type="text" name="day" value="" size="10" maxlength="2"></td></tr>');
	f.write('<tr><td>收購物品:</td><td><input type="text" name="item_id" value="" size="10" ></td><td>收購數量:</td><td><input type="text" name="item_num" value="1" size="10" maxlength="2"></td></tr>');
	f.write('<tr><td colspan="2"><input type="button" value="取 消" onclick="history.go(-1)"></td><td colspan="2"><input type="button" value="確 定 送 出" onclick="parent.foot_turn3(\'sale\',\'sale2\',document.f1.item_id.value,document.f1.money.value,document.f1.day.value,document.f1.item_num.value)"></td></tr>');
	f.write('<tr><td colspan="4" class=b1><ol><li>收購時間不能超過１０天</li><li>武器防具類收購數量強制為1</li><li>張貼收購會預收出價金額</li><li>每次張貼收購會收出價金額的１％手續費</li><li>收購到期且無人進行交易時金額會返回玩家身上</li></ol></td></tr>');
	f.write(temp_tebla2);
	f.write('</form>'); 
};
function sale2_view(saletotal,page,s,type)
{
	message_cls();
	var f=parent.wog_view.document;
	f.write('<form action="wog_etc.php" method="get" name="pageform" target="mission">');
	pagesplit(saletotal,page);
	f.write('<input type="hidden" name="page" value="1">');
	f.write('<input type="hidden" name="type" value="'+type+'">');
	f.write('<input type="hidden" name="f" value="sale">');
	f.write('<input type="hidden" name="act" value="view2">');
	f.write(temp_tebla1);
	f.write('<tr><td colspan="17" bgcolor="#4B689E">收 購 物 品</td></tr>');
	f.write('<tr><td colspan="17"><input type="button" value="武器" onclick="parent.sel_type(\'0\')" '+(type=='0'?'disabled':'')+'> <input type="button" value="頭部" onclick="parent.sel_type(\'1\')" '+(type=='1'?'disabled':'')+'> <input type="button" value="身體" onclick="parent.sel_type(\'2\')" '+(type=='2'?'disabled':'')+'> <input type="button" value="手套" onclick="parent.sel_type(\'3\')" '+(type=='3'?'disabled':'')+'> <input type="button" value="鞋子" onclick="parent.sel_type(\'4\')" '+(type=='4'?'disabled':'')+'> <input type="button" value="道具" onclick="parent.sel_type(\'5\')" '+(type=='5'?'disabled':'')+'> <input type="button" value="座騎" onclick="parent.sel_type(\'7\')" '+(type=='7'?'disabled':'')+'> <input type="button" value="精靈" onclick="parent.sel_type(\'8\')" '+(type=='8'?'disabled':'')+'> <input type="button" value="稱號" onclick="parent.sel_type(\'9\')" '+(type=='9'?'disabled':'')+'> <input type="button" value="符咒" onclick="parent.sel_type(\'10\')" '+(type=='10'?'disabled':'')+'></td></tr>');
	f.write('</form>');
	f.write('<form action="wog_act.php" method="post" target="mission" name=f1>');
	switch(type)
	{
		case 10:
			f.write('<tr><td>收購者</td><td>商品</td><td colspan="7">狀態效果</td><td>金額</td><td>原價</td><td>結束時間</td><td>選擇</td></tr>');
		break;
		default:
			f.write('<tr><td>收購者</td><td>商品</td><td>物攻</td><td>魔攻</td><td>物防</td><td>魔防</td><td>速度</td><td>運氣</td><td>職業</td><td>金額</td><td>原價</td><td>結束時間</td><td>選擇</td></tr>');
		break;
	}
	var s1=s.split(";");
	if(s != "")
	{
		for(var i=0;i<s1.length;i++)
		{
			var s2=s1[i].split(",");
			var seeatt="";
			if(s2[14].length>0){
			while(s2[14].indexOf("&n") > 0) 
			{ 
			s2[14]=s2[14].replace("&n","\r\n"); 
			}
			seeatt="<img src='"+img+"icon3.gif' alt='"+s2[14]+"'>";
			}
			var num=""
			if(type==5){
				num="*"+s2[12]+"";
			}
			switch(type)
			{
				case 10:
					f.write('<tr onMouseOver="this.style.backgroundColor=\'#0000CD\'" onMouseOut="this.style.backgroundColor=\'\'" onclick="parent.setRadioValue(\'s_id\','+s2[8]+');" style="cursor:hand"><td>'+s2[0]+'</td><td><a href="javascript:parent.foot_turn(\'arm\',\'check_item\','+s2[13]+')">'+s2[1]+'</a>'+num+'</td><td colspan="7">'+s2[14]+'</td><td>'+s2[9]+'</td><td>'+s2[7]+'</td><td>'+s2[10]+'</td><td><input type="radio" name="s_id" value="'+s2[8]+'"></td></tr>'); 
				break;
				default:
					f.write('<tr onMouseOver="this.style.backgroundColor=\'#0000CD\'" onMouseOut="this.style.backgroundColor=\'\'" onclick="parent.setRadioValue(\'s_id\','+s2[8]+');" style="cursor:hand"><td>'+s2[0]+'</td><td><a href="javascript:parent.foot_turn(\'arm\',\'check_item\','+s2[13]+')">'+s2[1]+'</a>'+num+seeatt+'</td><td>'+s2[2]+'</td><td>'+s2[3]+'</td><td>'+s2[4]+'</td><td>'+s2[5]+'</td><td>'+s2[6]+'</td><td>'+s2[15]+'</td><td>'+s2[11]+'</td><td>'+s2[9]+'</td><td>'+s2[7]+'</td><td>'+s2[10]+'</td><td><input type="radio" name="s_id" value="'+s2[8]+'"></td></tr>'); 
				break;
			}
		}
	}
	f.write('<tr><td colspan="18"><input type="submit" value="確定收購者"> <input type="button" value="張貼收購" onclick="parent.sale2_post();"></td></tr>');
	f.write('<input type="hidden" name="f" value="sale">');
	f.write('<input type="hidden" name="act" value="buy2">');
	f.write('<input type="hidden" name="type" value="'+type+'">');
	f.write(temp_tebla2);
	f.write('</form>');
	f.write('<div id="sel_item"></div>');
	f.write('<span id="wog_message_box"></span>');
};

function arm2_view(a1,a4,a5)
{
	var f=parent.wog_view.document;
	var temp_str="";
	temp_str+='<form action="wog_act.php" method="post" target="mission" name=f1>'+temp_tebla1;
	temp_str+='<tr class="head_td"><td>選擇</td><td>名稱</td><td>物攻</td><td>魔攻</td><td>物防</td><td>魔防</td><td>速度</td><td>運氣</td><td>力量</td><td>智力</td><td>體質</td><td>信仰</td><td>生命</td><td>魅力</td></tr>';
	if(a1!="")
	{
		var s1=a1.split(";");
		for(var i=0;i<s1.length;i++)
		{
			var s2=s1[i].split(",");
			var seeatt="";
			if(s2[19].length>0){
			while(s2[19].indexOf("&n") > 0) 
			{ 
			s2[19]=s2[19].replace("&n","\r\n"); 
			}
			seeatt="<img src='"+img+"icon3.gif' alt='"+s2[19]+"'>";
			}
			temp_str+='<tr onMouseOver="this.style.backgroundColor=\'#0000CD\'" onMouseOut="this.style.backgroundColor=\'\'" onclick="parent.setRadioValue(\'adds\','+s2[0]+');" style="cursor:hand"><td><input type="radio" name="adds" value="'+s2[0]+'"></td><td><a href="javascript:parent.foot_turn(\'arm\',\'check_item\','+s2[20]+')">'+s2[1]+'</a>'+seeatt+'</td><td>'+s2[2]+'</td><td>'+s2[3]+'</td><td>'+s2[4]+'</td><td>'+s2[5]+'</td><td>'+s2[6]+'</td><td>'+s2[21]+'</td><td>'+s2[7]+'</td><td>'+s2[8]+'</td><td>'+s2[9]+'</td><td>'+s2[10]+'</td><td>'+s2[11]+'</td><td>'+s2[12]+'</td></tr>';
		}
		temp_str+='<tr><td colspan="14"><input type="submit" value="確 定 賣 出"></td></tr>';
	}else{
		temp_str+='<tr class="head_td"><td colspan="14">沒 有 收 購 的 所 需 物 品</td></tr>';
	}
	temp_str+=temp_tebla2;
	temp_str+='<input type="hidden" name="f" value="sale">';
	temp_str+='<input type="hidden" name="act" value="buy2_1">';
	temp_str+='<input type="hidden" name="s_id" value="'+a5+'">';
	temp_str+='<input type="hidden" name="type" value='+a4+'>';
	temp_str+="</form>";
	f.getElementById("sel_item").innerHTML=temp_str;
}
function f_list(f_name)//##friend_system 
{ 
   message_cls(); 
   var f=parent.wog_view.document; 
   f.write(temp_tebla1); 
   f.write('<tr><td width=70%>好友名稱</td><td width=30%>線上狀態</td></tr>'); 
   if(f_name) 
   { 
      s1=f_name.split(";"); 
      for(var a=0;a<s1.length;a++) 
      { 
         s2=s1[a].split(","); 
         var fcolor=psex(s2[2]); 
         f.write('<tr><td><a href=javascript:parent.yesname("'+s2[0]+'")><font color='+fcolor+'>'+s2[0]+'</font></a></td><td>'+s2[1]+'</td></tr>'); 
      } 
   }else 
   { 
      f.write('<tr><td colspan=2>沒有任何好友資料。</td></tr>');    
   } 
   f.write('<tr><td colspan=2>'); 
   f.write('<form action="wog_etc.php" method="GET">'); 
   f.write('<input type=text name=f_name><input type=radio name="act" value=add CHECKED>新增<input type=radio name="act" value=del>刪除 <input type=submit value="送出"><input type=hidden name="f" value="friend"> <input type=button value="資料全刪除" onClick="parent.del_all_con()"></form>'); 
   f.write(temp_tebla2); 
} 
function del_all_con() 
{ 
   if(confirm("確定刪除所有好友資料？")==true) 
   { 
      parent.wog_view.document.URL="./wog_etc.php?f=friend&act=del_all"; 
   } 
}
//###### 分頁 begin #####
function pagesplit(saletotal,page)
{
	var f=parent.wog_view.document; 
	var temp_html="";
	temp_html+=temp_tebla1+'<tr><td>';
	var totalpage=0;
	if(saletotal%8==0)
	{
		totalpage=saletotal/8;
	}else
	{
		totalpage=(saletotal/8)+1;
	}
	if(page!=1 && page>0)
	{
		var before=page-1;
		temp_html+='<a href=javascript:parent.page_jump(\''+before+'\')><img src="'+img+'arrow_left.gif" border="0"></a>';
	}
	for(var i=1;i<=totalpage;i++)
	{
		if(i==page)
		{
			temp_html+=' '+i+' ';
		}else
		{
			temp_html+=' <a href="javascript:parent.page_jump(\''+i+'\')" >'+i+'</a> ';
		}
	}
	if(page!=i-1 && (i-1)>0)
	{
		var next=page+1;
		temp_html+='<a href=javascript:parent.page_jump(\''+next+'\')><img src="'+img+'arrow_right.gif" border="0"></a>';
	}
	temp_html+='</td></tr>'+temp_tebla2;
	f.write(temp_html);
}
function page_jump(s)
{
	wog_view.document.pageform.page.value=s;
	wog_view.document.pageform.submit();
}
function sel_type(s)
{
	wog_view.document.pageform.type.value=s;
	wog_view.document.pageform.submit();
}
//#### view begin ####
function login_view(p_win,p_lost,p_img_set,i_img,p_name,p_sex,ch_name,p_s,p_lv,p_st,p_exp,p_nextexp,p_money,p_hp,p_hpmax,p_str,p_smart,p_agl,p_life,p_vit,p_au,p_be,p_at,p_mat,p_df,p_mdf,a_name,body_name,head_name,hand_name,foot_name,item_name,ride_name,spirit_name,title_name,state_name,p_url,p_homename,s_ch_name,p_sat_name,p_place,p_birth,p_cdate,bbsid,p_rebirth,p_luck,p_arm_time,skill,aa_id,b_id,c_id,d_id,e_id,f_id,r_id,sp_id,t_id,st_id,p_count,active_ch,active_color)
{
	message_cls();
	setup_name(p_name);
	setup_sat_name(p_sat_name);
	setup_bbsid(bbsid);
	d_ch_name=ch_name;
	d_s_ch_name=s_ch_name;
	a_id=aa_id; 
    d_body_id=b_id; 
    d_head_id=c_id; 
    d_hand_id=d_id; 
    d_foot_id=e_id; 
    d_item_id=f_id; 
    d_ride_id=r_id;
	d_spirit_id=sp_id;
	d_title_id=t_id;
	d_state_id=st_id;
   //武器 
   if(a_id==1){ 
     d_a_name="<font color=#32cd32>"+a_name+"</font>"; 
   }else if(a_id==2){ 
     d_a_name="<font color=3366FF>"+a_name+"</font>"; 
   }else if(a_id==3){ 
     d_a_name="<font color=#cc66cc>"+a_name+"</font>"; 
   }else if(a_id==4){ 
     d_a_name="<font color=#ff9933>"+a_name+"</font>"; 
   }else{ 
    d_a_name=a_name; 
   } 
   //衣服 
   if(d_body_id==1){ 
     d_body_name="<font color=#32cd32>"+body_name+"</font>"; 
   }else if(d_body_id==2){ 
     d_body_name="<font color=3366FF>"+body_name+"</font>"; 
   }else if(d_body_id==3){ 
     d_body_name="<font color=#cc66cc>"+body_name+"</font>"; 
   }else if(d_body_id==4){ 
     d_body_name="<font color=#ff9933>"+body_name+"</font>"; 
   }else{ 
      d_body_name=body_name; 
   } 
   //頭盔 
   if(d_head_id==1){ 
     d_head_name="<font color=#32cd32>"+head_name+"</font>"; 
   }else if(d_head_id==2){ 
     d_head_name="<font color=3366FF>"+head_name+"</font>"; 
   }else if(d_head_id==3){ 
     d_head_name="<font color=#cc66cc>"+head_name+"</font>"; 
   }else if(d_head_id==3){ 
     d_head_name="<font color=#ff9933>"+head_name+"</font>"; 
   }else if(d_head_id==4){ 
     d_head_name="<font color=#ff9933>"+head_name+"</font>"; 
   }else{ 
      d_head_name=head_name; 
   } 
   //手部 
   if(d_hand_id==1){ 
     d_hand_name="<font color=#32cd32>"+hand_name+"</font>"; 
   }else if(d_hand_id==2){ 
     d_hand_name="<font color=3366FF>"+hand_name+"</font>"; 
   }else if(d_hand_id==3){ 
     d_hand_name="<font color=#cc66cc>"+hand_name+"</font>"; 
   }else if(d_hand_id==4){ 
     d_hand_name="<font color=#ff9933>"+hand_name+"</font>"; 
   }else{ 
      d_hand_name=hand_name; 
   } 
   //腳部 
   if(d_foot_id==1){ 
     d_foot_name="<font color=#32cd32>"+foot_name+"</font>"; 
   }else if(d_foot_id==2){ 
     d_foot_name="<font color=3366FF>"+foot_name+"</font>"; 
   }else if(d_foot_id==3){ 
     d_foot_name="<font color=#cc66cc>"+foot_name+"</font>"; 
   }else if(d_foot_id==4){ 
     d_foot_name="<font color=#ff9933>"+foot_name+"</font>"; 
   }else{ 
      d_foot_name=foot_name; 
   } 
  //item 
   if(d_item_id==1){ 
     d_item_name="<font color=#32cd32>"+item_name+"</font>"; 
   }else if(d_item_id==2){ 
     d_item_name="<font color=3366FF>"+item_name+"</font>"; 
   }else if(d_item_id==3){ 
     d_item_name="<font color=#cc66cc>"+item_name+"</font>"; 
   }else if(d_item_id==4){ 
     d_item_name="<font color=#ff9933>"+item_name+"</font>"; 
   }else{ 
      d_item_name=item_name; 
   } 
  //ride 
   if(d_ride_id==1){ 
     d_ride_name="<font color=#32cd32>"+ride_name+"</font>"; 
   }else if(d_ride_id==2){ 
     d_ride_name="<font color=3366FF>"+ride_name+"</font>"; 
   }else if(d_ride_id==3){ 
     d_ride_name="<font color=#cc66cc>"+ride_name+"</font>"; 
   }else if(d_ride_id==4){ 
     d_ride_name="<font color=#ff9933>"+ride_name+"</font>"; 
   }else{ 
      d_ride_name=ride_name; 
   } 
  //spirit
   if(d_spirit_id==1){ 
     d_spirit_name="<font color=#32cd32>"+spirit_name+"</font>"; 
   }else if(d_spirit_id==2){ 
     d_spirit_name="<font color=3366FF>"+spirit_name+"</font>"; 
   }else if(d_spirit_id==3){ 
     d_spirit_name="<font color=#cc66cc>"+spirit_name+"</font>"; 
   }else if(d_spirit_id==4){ 
     d_spirit_name="<font color=#ff9933>"+spirit_name+"</font>"; 
   }else{ 
      d_spirit_name=spirit_name; 
   } 
  //稱號 
   if(d_title_id==1){ 
     d_title_name="<font color=#32cd32>"+title_name+"</font>"; 
   }else if(d_title_id==2){ 
     d_title_name="<font color=3366FF>"+title_name+"</font>"; 
   }else if(d_title_id==3){ 
     d_title_name="<font color=#cc66cc>"+title_name+"</font>"; 
   }else if(d_title_id==4){ 
     d_title_name="<font color=#ff9933>"+title_name+"</font>"; 
   }else{ 
      d_title_name=title_name; 
   } 
  //狀態 
   if(d_state_id==1){ 
     d_state_name="<font color=#32cd32>"+state_name+"</font>"; 
   }else if(d_state_id==2){ 
     d_state_name="<font color=3366FF>"+state_name+"</font>"; 
   }else if(d_state_id==3){ 
     d_state_name="<font color=#cc66cc>"+state_name+"</font>"; 
   }else if(d_state_id==4){ 
     d_state_name="<font color=#ff9933>"+state_name+"</font>"; 
   }else{ 
      d_state_name=state_name; 
   } 
	d_p_url=p_url;
	d_p_homename=p_homename;
	my_birth=birth[p_birth];
	my_age=p_cdate;
	status_view(p_win,p_lost,p_img_set,i_img,p_sex,p_s,p_lv,p_st,p_exp,p_nextexp,p_money,p_hp,p_hpmax,p_str,p_smart,p_agl,p_life,p_vit,p_au,p_be,p_at,p_mat,p_df,p_mdf,p_place,p_rebirth,p_luck,p_arm_time,skill,p_count);
	foot_fire();
}
function show_status(p_win,p_lost,p_img_set,i_img,p_sex,p_s,p_lv,p_st,p_exp,p_nextexp,p_money,p_hp,p_hpmax,p_str,p_smart,p_agl,p_life,p_vit,p_au,p_be,p_at,p_mat,p_df,p_mdf,p_place,p_rebirth,p_luck,p_arm_time,skill,p_count)
{
	message_cls();
	status_view(p_win,p_lost,p_img_set,i_img,p_sex,p_s,p_lv,p_st,p_exp,p_nextexp,p_money,p_hp,p_hpmax,p_str,p_smart,p_agl,p_life,p_vit,p_au,p_be,p_at,p_mat,p_df,p_mdf,p_place,p_rebirth,p_luck,p_arm_time,skill,p_count);
}
function well_view(p_win,p_lost,p_img_set,i_img,p_name,p_sex,ch_name,p_s,p_lv,p_exp,p_nextexp,p_money,p_hp,p_hpmax,p_str,p_smart,p_agl,p_life,p_vit,p_au,p_be,p_at,p_mat,p_df,p_mdf,a_name,d_name,e_name,dd_name,c_name,item_name,r_name,sp_name,t_name,st_name,p_place,p_birth,p_cdate,del_day,f_time,p_url,p_homename,s_ch_name,win_num,cp_mmoney,a_win,p_rebirth)
{
	message_cls();
	var f=parent.wog_view.document;
	f.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
	f.write('<tr>');
	f.write('<td  width="50%" valign="top"><img src="img/sw1.gif" border="0" >');
	f.write('</td>');
	f.write('<td valign="top" class="b1">');
	chara_make(del_day,f_time);
	f.write('</td>');
	f.write('</tr>');
	f.write('</table>');
	setup_jmmoney(cp_mmoney);
}
function cp_view(p_win,p_lost,p_img_set,i_img,p_name,p_sex,ch_name,p_s,p_lv,p_st,p_exp,p_nextexp,p_money,p_hp,p_hpmax,p_str,p_smart,p_agl,p_life,p_vit,p_au,p_be,p_at,p_mat,p_df,p_mdf,a_name,d_name,e_name,dd_name,c_name,item_name,r_name,sp_name,t_name,st_name,p_place,p_birth,p_cdate,p_url,p_homename,s_ch_name,win_num,a_win,p_rebirth,g_name,lastonline)
{
	var cp_name=parent.wog_view;
	message_cls();
	if(!lastonline)
	{
		var lastonline=1;
	}
	status_view2(p_win,p_lost,p_img_set,i_img,p_name,p_sex,ch_name,p_s,p_lv,p_st,p_exp,p_nextexp,p_money,p_hp,p_hpmax,p_str,p_smart,p_agl,p_life,p_vit,p_au,p_be,p_at,p_mat,p_df,p_mdf,a_name,d_name,e_name,dd_name,c_name,item_name,r_name,sp_name,t_name,st_name,p_place,p_birth,p_cdate,p_url,p_homename,s_ch_name,win_num,p_rebirth,g_name,lastonline);
}
function a_view(a_win)
{
	var f=parent.wog_view.document;
	f.write('<tr><td width="100%" colspan="2" valign="top">比武大會前三名</td></tr>');
	f.write('<tr><td width="100%" colspan="2" valign="top">');
	var s1=a_win.split(";");
	var temp_s="";
	for(var i=0;i<s1.length;i++)
	{	
		var s2=s1[i].split(",");
		temp_s+=' | '+s2[0]+' 連勝 <font color=red>'+s2[1]+'</font> 人';
	}
	temp_s=temp_s.substr(3,temp_s.length);
	f.write(temp_s+'</td></tr>');
}
function status_view(p_win,p_lost,p_img_set,i_img,p_sex,p_s,p_lv,p_st,p_exp,p_nextexp,p_money,p_hp,p_hpmax,p_str,p_smart,p_agl,p_life,p_vit,p_au,p_be,p_at,p_mat,p_df,p_mdf,p_place,p_rebirth,p_luck,p_arm_time,skill,p_count)
{
	var f=parent.wog_view.document;
	var p_img="";
	if(p_img_set==1)
	{
		p_img=i_img;
	}else
	{
		p_img=img+i_img+".gif";
	}
	load_img(p_img,150,150);
	var sex="";
	(p_sex=="1")?sex="男":sex="女";
	p_s=s_status(p_s);
	var p_strf=get_f(p_str,65000);
	var p_smartf=get_f(p_smart,65000);
	var p_aglf=get_f(p_agl,65000);
	var p_lifef=get_f(p_life,65000);
	var p_auf=get_f(p_au,65000);
	var p_bef=get_f(p_be,65000);
	var p_vitf=get_f(p_vit,65000);
	var p_atf=get_f(p_at,65000);
	var p_matf=get_f(p_mat,65000);
	var p_dff=get_f(p_df,65000);
	var p_mdff=get_f(p_mdf,65000);
	var p_luckf=get_f(p_luck,2000);
	//EXP&HPbar_Start 
	var p_expf=(p_exp/p_nextexp)*100; 
	if(p_expf > 1){if(p_expf < 99){p_expf=Math.round(p_expf);}else{p_expf=Math.floor(p_expf);}}else{p_expf=Math.ceil(p_expf);} 
	var p_nextexpf=99-p_expf; 
	var p_hpf=(p_hp/p_hpmax)*100; 
	if(p_hpf > 1){if(p_hpf < 99){p_hpf=Math.round(p_hpf);}else{p_hpf=Math.floor(p_hpf);}}else{p_hpf=Math.ceil(p_hpf);} 
	var p_hpmaxf=99-p_hpf;
	//EXP&HPbar_End 
	var now_date=new Date();
	var p_arm_time=Math.ceil((p_arm_time-(now_date.getTime()/1000))/60);
	var vip='';
	(p_st!=0)?vip='<a href="javascript://" onclick="parent.act_click(\'vip\',\'view\')"><img src="'+img+'vip.gif" alt="'+p_st+'級VIP" border="0" style="margin-bottom:-3px" ></a>':vip='';
	f.write(temp_tebla1);
	f.write('<tr><td width=45% colspan="3"><b>英 雄 檔 案</b><br><a href="'+d_p_url+'" target="_blank" title="'+d_p_url+'">'+d_p_homename+'</a></td><td width=20% bgcolor="#4B689E">'+vip+'<b>'+p_name+'</b></td><td width=35% colspan="3">WIN '+p_win+' / LOST '+p_lost+'<br>')
	if((p_win+p_lost)==0 || p_win==0)
	{
		f.write('獲勝率:<b>0%</b>')
	}else
	{
		f.write('獲勝率:<b>'+Math.floor((p_win/(p_win+p_lost))*100)+'%</b>');
	}
	f.write('</td></tr>');
	f.write('<tr><td width="7%" bgcolor="#417D60">等級</td><td><b>'+p_rebirth+'</b> 轉 - <b>'+p_lv+'</b> LV</td><td width="10%"><b>'+sex+' '+my_age+' 歲</b></td>');
	f.write('<td rowspan="9">');
	f.write('<img src="'+p_img+'" height="'+height+'" width="'+width+'" border="0" vspace="1" alt="頭像"><br>');
	if(p_arm_time>=0) 
	{
		f.write('<br>'+d_state_name+' '+p_arm_time+'</b>分鐘');
	}
	if(skill.length > 0)
	f.write(skill);
	//f.write('<br><a href="javascript://" onclick="parent.act_click(\'count\',\'count_confirm\')">剩餘「<b>'+p_count+'</b>」點潛能</a>');
	f.write('</td>');
	f.write('<td><b><span onmouseover="parent.textboard_view('+desc_id[0]+',event)" onmouseout="parent.textboard_close()">'+d_a_name+'</span></b></td><td width="5%"><img src="'+pic+'D1.gif" alt="武器"></td></tr>');
	f.write('<tr><td bgcolor="#417D60">出生</td><td><b>'+my_birth+'</b></td><td><b>'+p_s+'</b> 屬性</td>');
	f.write('<td><b><span onmouseover="parent.textboard_view('+desc_id[1]+',event)" onmouseout="parent.textboard_close()">'+d_head_name+'</span></b></td><td><img src="'+pic+'D2.gif" alt="頭部"></td></tr>');
	f.write('<tr><td bgcolor="#417D60">金錢</td><td colspan="2"><b>'+p_money+'</b></td>');
	f.write('<td><b><span onmouseover="parent.textboard_view('+desc_id[2]+',event)" onmouseout="parent.textboard_close()">'+d_body_name+'</span></b></td><td><img src="'+pic+'D3.gif" alt="身體"></td></tr>');
	f.write('<tr><td bgcolor="#339933">冒險</td><td colspan="2"><b>'+sec[p_place]+'</b></td>');
	f.write('<td><b><span onmouseover="parent.textboard_view('+desc_id[3]+',event)" onmouseout="parent.textboard_close()">'+d_hand_name+'</span></b></td><td><img src="'+pic+'D4.gif" alt="手部"></td></tr>');
	f.write('<tr><td bgcolor="#339933">職業</td><td colspan="2"><b>'+d_ch_name+'</b>');
	if(d_s_ch_name != '') 
	{ 
		f.write('　( '+d_s_ch_name+' 奧義)');
	}
	f.write('</td>');
	f.write('<td><b><span onmouseover="parent.textboard_view('+desc_id[4]+',event)" onmouseout="parent.textboard_close()">'+d_foot_name+'</span></b></td><td><img src="'+pic+'D5.gif" alt="腳部"></td></tr>');
	f.write('<tr><td bgcolor="#A65554">公會</td><td colspan="2"><b>'+p_group+'</b></td>');
	f.write('<td><b><span onmouseover="parent.textboard_view('+desc_id[5]+',event)" onmouseout="parent.textboard_close()">'+d_item_name+'</span></b></td><td><img src="'+pic+'D6.gif" alt="道具"></td></tr>');
	f.write('<tr><td bgcolor="#A65554">頭銜</td><td colspan="2"><b>'+p_style+'</b></td>');
	f.write('<td><b><span onmouseover="parent.textboard_view('+desc_id[7]+',event)" onmouseout="parent.textboard_close()">'+d_ride_name+'</span></b></td><td><img src="'+pic+'D8.gif" alt="座騎"></td></tr>');
	f.write('<tr><td bgcolor="#42417D">血量</td><td colspan="2"><b>'+p_hp+' / '+p_hpmax+'</b><table borderColor="#000000" cellSpacing="0" cellPadding="0" width="100%" border="0"><td width="3" height="13"><img src="'+img+'bar/img_left.gif" width="3" height="13"></td><td class="b1" width="100%-6" background="'+img+'bar/img_backing.gif" title="'+p_hpf+'%" height="13"><img height="9" src="'+img+'bar/bhg.gif" width="'+p_hpf+'%" ></td><td width="3" height="13"><img src="'+img+'bar/img_right.gif" width="3" height="13"></td></table></td>');
	f.write('<td><b><span onmouseover="parent.textboard_view('+desc_id[8]+',event)" onmouseout="parent.textboard_close()">'+d_spirit_name+'</span></b></td><td><img src="'+pic+'D7.gif" alt="精靈"></td></tr>');
	f.write('<tr><td bgcolor="#42417D">經驗</td><td colspan="2"><b>'+p_exp+' / '+p_nextexp+'</b><table borderColor="#000000" cellSpacing="0" cellPadding="0" width="100%" border="0"><td width="3" height="13"><img src="'+img+'bar/img_left.gif" width="3" height="13"></td><td class="b1" width="100%-6" background="'+img+'bar/img_backing.gif" title="'+p_expf+'%" height="13"><img height="9" src="'+img+'bar/bxg.gif" width="'+p_expf+'%" ></td><td width="3" height="13"><img src="'+img+'bar/img_right.gif" width="3" height="13"></td></table></td>');
	f.write('<td><b><span onmouseover="parent.textboard_view('+desc_id[9]+',event)" onmouseout="parent.textboard_close()">'+d_title_name+'</span></b></td><td><img src="'+pic+'D9.gif" alt="稱號"></td></tr>');
	f.write(temp_tebla2);
	f.write(temp_tebla1);
	f.write('<br><tr><td width=10% bgcolor="#005581">力量</td><td class="b1" width=40%><img src="'+img+'bar/1.gif" width="'+p_strf+'%" height="9"></br><b>'+p_str+'</b></td>');
	f.write('<td width=10% bgcolor="#005581">智力</td><td class="b1" width=40%><img src="'+img+'bar/1.gif" width="'+p_smartf+'%" height="9"></br><b>'+p_smart+'</b></td></tr>')
	f.write('<tr><td width=10% bgcolor="#005581">敏捷</td><td class="b1" width=40%><img src="'+img+'bar/5.gif" width="'+p_aglf+'%" height="9"></br><b>'+p_agl+'</b></td>');
	f.write('<td width=10% bgcolor="#005581">生命</td><td class="b1" width=40%><img src="'+img+'bar/5.gif" width="'+p_lifef+'%" height="9"></br><b>'+p_life+'</b></td></tr>')
	f.write('<tr><td width=10% bgcolor="#005581">魅力</td><td class="b1" width=40%><img src="'+img+'bar/8.gif" width="'+p_auf+'%" height="9"></br><b>'+p_au+'</b></td>');
	f.write('<td width=10% bgcolor="#005581">信仰</td><td class="b1" width=40%><img src="'+img+'bar/8.gif" width="'+p_bef+'%" height="9"></br><b>'+p_be+'</b></td></tr>')
	f.write('<tr><td width=10% bgcolor="#005581">體質</td><td class="b1" width=40%><img src="'+img+'bar/8.gif" width="'+p_vitf+'%" height="9"></br><b>'+p_vit+'</b></td>');
	f.write('<td width=10% bgcolor="#005581">運氣</td><td class="b1" width=40%><img src="'+img+'bar/8.gif" width="'+p_luckf+'%" height="9"></br><b>'+p_luck+'</b></td></tr>')
	f.write('<tr><td width=10% bgcolor="#005581">物攻</td><td class="b1" width=40%><img src="'+img+'bar/2.gif" width="'+p_atf+'%" height="9"></br><b>'+p_at+'</b></td>');
	f.write('<td width=10% bgcolor="#005581">魔攻</td><td class="b1" width=40%><img src="'+img+'bar/2.gif" width="'+p_matf+'%" height="9"></br><b>'+p_mat+'</b></td></tr>')
	f.write('<tr><td width=10% bgcolor="#005581">物防</td><td class="b1" width=40%><img src="'+img+'bar/9.gif" width="'+p_dff+'%" height="9"></br><b>'+p_df+'</b></td>');
	f.write('<td width=10% bgcolor="#005581">魔防</td><td class="b1" width=40%><img src="'+img+'bar/9.gif" width="'+p_mdff+'%" height="9"></br><b>'+p_mdf+'</b></td></tr>')
	f.write(temp_tebla2);
}
//裝備資訊(開始)
var txt = new Array(); 
var desc_id=new Array(0,0,0,0,0,0,0,0,0,0); 
function description(id,name,d_type,at,mat,df,mdf,agl,mstr,magl,msmart,ch_name,s,send,luck) 
{ 
   if(!txt[id]) 
   { 
      switch(d_type) 
      { 
         case 0: 
         d_type="武器"; 
         break; 
         case 1: 
         d_type="頭部"; 
         break; 
         case 2: 
         d_type="身體"; 
         break; 
         case 3: 
         d_type="手部"; 
         break; 
         case 4: 
         d_type="腳部"; 
         break; 
         case 5: 
         d_type="道具"; 
         break; 
         case 6: 
         d_type="特殊"; 
         break;
         case 7: 
         d_type="座騎"; 
         break;
         case 8: 
         d_type="精靈"; 
         break;
         case 9: 
         d_type="稱號"; 
         break;
         case 10: 
         d_type="符咒"; 
         break;
         default: 
         d_type="未知"; 
         break; 
      } 
      switch(s) 
      { 
         case "1": 
         s=' (<font color="#FFBF9F">地</font>)'; 
         break; 
         case "2": 
         s=' (<font color="#9F9FFF">水</font>)'; 
         break; 
         case "3": 
         s=' (<font color="#FF9F9F">火</font>)'; 
         break; 
         case "4": 
         s=' (<font color="#9FFF9F">木</font>)'; 
         break; 
         case "5": 
         s=' (<font color="#9FFFFF">風</font>)'; 
         break; 
         case "6": 
         s=' (<font color="#FF9FFF">毒</font>)'; 
         break; 
         default: 
         s=""; 
         break; 
      } 
	  ch_name=ch_name?'<BR>限定職業：'+ch_name:'';
	  luck=luck!='0'?'<BR>運氣：'+luck:'';
      if(send==1) 
		{ 
			send='<tr><td bgcolor="#444444" style="border:1px solid #4B689E">已綁定</td></tr>'; 
		}else 
		{ 
			send=""; 
		} 
		txt[id]='<TABLE STYLE="background-image: url('+img+'W_hs03.gif);" BORDER=0 cellspacing=0 cellpadding=0 width="160"><tr><td bgcolor="#191970"><table border=0 width="100%" style="position:relative" cellspacing=0 cellpadding=2><tr><td width="75%" style="text-align:left">'+name+s+'</td><td width="25%">'+d_type+'</td></tr></table></td></tr><tr><td><table border=0 width="100%" style="position:relative;"><tr><td style="text-align:left">物攻擊力：'+at+'<br>魔攻擊力：'+mat+'<br>物防禦力：'+df+'<br>魔防禦力：'+mdf+'<br>速度：'+agl+luck+'<br>需求力量：'+mstr+'<BR>需求速度：'+magl+'<BR>需求智力：'+msmart+ch_name+'</td></tr>'+send+'</table></td></tr></table>'; 
	} 
} 
function textboard_view(txt_id,event) 
{ 
	var f=parent.wog_view.frameElement;
	var board=parent.wog_view.showboard; 
	if(!txt[txt_id])return false; 
	board.innerHTML=txt[txt_id]; 
	var maxtop=(f.height<200)?f.height:200;
	var Btop=(event.clientY+160 > f.height)?f.height-maxtop:event.clientY-40; 
	board.style.left=event.clientX-200+parent.wog_view.document.body.scrollLeft; 
	board.style.top=Btop+parent.wog_view.document.body.scrollTop; 
	board.style.display=""; 
} 
function textboard_close() 
{ 
	parent.wog_view.showboard.style.display="none"; 
}
//裝備資訊(完)
function status_view2(p_win,p_lost,p_img_set,i_img,p_name,p_sex,ch_name,p_s,p_lv,p_st,p_exp,p_nextexp,p_money,p_hp,p_hpmax,p_str,p_smart,p_agl,p_life,p_vit,p_au,p_be,p_at,p_mat,p_df,p_mdf,a_name,d_name,e_name,dd_name,c_name,item_name,r_name,sp_name,t_name,st_name,p_place,p_birth,p_cdate,p_url,p_homename,s_ch_name,win_num,p_rebirth,g_name,lastonline)
{
	var f=parent.wog_view.document;
	var p_img="";
	if(p_img_set==1)
	{
		p_img=i_img;
	}else
	{
		p_img=img+i_img+".gif";
	}
	load_img(p_img,150,150);
	var sex="";
	(p_sex=="1")?sex="男":sex="女";
	p_s=s_status(p_s);
	var p_strf=get_f(p_str,65000);
	var p_smartf=get_f(p_smart,65000);
	var p_aglf=get_f(p_agl,65000);
	var p_lifef=get_f(p_life,65000);
	var p_auf=get_f(p_au,65000);
	var p_bef=get_f(p_be,65000);
	var p_vitf=get_f(p_vit,65000);
	var p_atf=get_f(p_at,65000);
	var p_matf=get_f(p_mat,65000);
	var p_dff=get_f(p_df,65000);
	var p_mdff=get_f(p_mdf,65000);
	//EXP&HPbar_Start 
	var p_expf=(p_exp/p_nextexp)*100; 
	if(p_expf > 1){if(p_expf < 99){p_expf=Math.round(p_expf);}else{p_expf=Math.floor(p_expf);}}else{p_expf=Math.ceil(p_expf);} 
	var p_nextexpf=99-p_expf; 
	var p_hpf=(p_hp/p_hpmax)*100; 
	if(p_hpf > 1){if(p_hpf < 99){p_hpf=Math.round(p_hpf);}else{p_hpf=Math.floor(p_hpf);}}else{p_hpf=Math.ceil(p_hpf);} 
	var p_hpmaxf=99-p_hpf;
	//EXP&HPbar_End 
	var vip="";
	(p_st!=0)?vip="<img src='"+img+"vip.gif' alt='"+p_st+"級VIP' style='margin-bottom:-3px' >":vip="";
	f.write(temp_tebla1);
	var text="對 方 檔 案";
	(win_num>0)?text="冠 軍 檔 案":"";
	f.write('<tr><td width=45% colspan="3"><b>'+text+'</b><br><a href="'+p_url+'" target="_blank" title="'+p_url+'">'+p_homename+'</a></td><td width=20% bgcolor="#4B689E">'+vip+'<b>'+p_name+'</b></td><td width=35% colspan="3">WIN '+p_win+' / LOST '+p_lost+'<br>')
	if((p_win+p_lost)==0 || p_win==0)
	{
		f.write('獲勝率:<b>0%</b>')
	}else
	{
		f.write('獲勝率:<b>'+Math.floor((p_win/(p_win+p_lost))*100)+'%</b>');
	}
	f.write('</td></tr>');
	f.write('<tr><td width="7%" bgcolor="#417D60">等級</td><td><b>'+p_rebirth+'</b> 轉 - <b>'+p_lv+'</b> LV</td><td width="10%"><b>'+sex+' '+p_cdate+' 歲</b></td>');
	f.write('<td rowspan="9">');
	f.write('<img src="'+p_img+'" height="'+height+'" width="'+width+'" border="0" vspace="1" alt="頭像">');
	f.write('</td>');
	f.write('<td><b><span onmouseover="parent.textboard_view('+desc_id[0]+',event)" onmouseout="parent.textboard_close()">'+a_name+'</span></b></td><td width="5%"><img src="'+pic+'D1.gif" alt="武器"></td></tr>');
	f.write('<tr><td bgcolor="#417D60">出生</td><td><b>'+birth[p_birth]+'</b></td><td><b>'+p_s+'</b> 屬性</td>');
	f.write('<td><b><span onmouseover="parent.textboard_view('+desc_id[1]+',event)" onmouseout="parent.textboard_close()">'+e_name+'</span></b></td><td><img src="'+pic+'D2.gif" alt="頭部"></td></tr>');
	f.write('<tr><td bgcolor="#417D60">金錢</td><td colspan="2"><b>?????</b></td>');
	f.write('<td><b><span onmouseover="parent.textboard_view('+desc_id[2]+',event)" onmouseout="parent.textboard_close()">'+d_name+'</span></b></td><td><img src="'+pic+'D3.gif" alt="身體"></td></tr>');
	f.write('<tr><td bgcolor="#339933">冒險</td><td colspan="2"><b>'+sec[p_place]+'</b></td>');
	f.write('<td><b><span onmouseover="parent.textboard_view('+desc_id[3]+',event)" onmouseout="parent.textboard_close()">'+dd_name+'</span></b></td><td><img src="'+pic+'D4.gif" alt="手部"></td></tr>');
	f.write('<tr><td bgcolor="#339933">職業</td><td colspan="2"><b>'+ch_name+'</b>');
	if(s_ch_name != '') 
	 { 
		  f.write('　( '+s_ch_name+' 奧義)');
	 }
	f.write('</td>');
	f.write('<td><b><span onmouseover="parent.textboard_view('+desc_id[4]+',event)" onmouseout="parent.textboard_close()">'+c_name+'</span></b></td><td><img src="'+pic+'D5.gif" alt="腳部"></td></tr>');
	f.write('<tr><td bgcolor="#A65554">公會</td><td colspan="2"><b>'+g_name+'</b></td>');
	f.write('<td><b><span onmouseover="parent.textboard_view('+desc_id[5]+',event)" onmouseout="parent.textboard_close()">'+item_name+'</span></b></td><td><img src="'+pic+'D6.gif" alt="道具"></td></tr>');
	f.write('<tr><td bgcolor="#A65554">頭銜</td><td colspan="2"><b>'+p_style+'</b></td>');
	f.write('<td><b><span onmouseover="parent.textboard_view('+desc_id[7]+',event)" onmouseout="parent.textboard_close()">'+r_name+'</span></b></td><td><img src="'+pic+'D8.gif" alt="座騎"></td></tr>');
	f.write('<tr><td bgcolor="#42417D">血量</td><td colspan="2"><b>'+p_hp+' / '+p_hpmax+'</b><table borderColor="#000000" cellSpacing="0" cellPadding="0" width="100%" border="0"><td width="3" height="13"><img src="'+img+'bar/img_left.gif" width="3" height="13"></td><td class="b1" width="100%-6" background="'+img+'bar/img_backing.gif" title="'+p_hpf+'%" height="13"><img height="9" src="'+img+'bar/bhg.gif" width="'+p_hpf+'%" ></td><td width="3" height="13"><img src="'+img+'bar/img_right.gif" width="3" height="13"></td></table></td>');
	f.write('<td><b><span onmouseover="parent.textboard_view('+desc_id[8]+',event)" onmouseout="parent.textboard_close()">'+sp_name+'</span></b></td><td><img src="'+pic+'D7.gif" alt="精靈"></td></tr>');
	f.write('<tr><td bgcolor="#42417D">經驗</td><td colspan="2"><b>'+p_exp+' / '+p_nextexp+'</b><table borderColor="#000000" cellSpacing="0" cellPadding="0" width="100%" border="0"><td width="3" height="13"><img src="'+img+'bar/img_left.gif" width="3" height="13"></td><td class="b1" width="100%-6" background="'+img+'bar/img_backing.gif" title="'+p_expf+'%" height="13"><img height="9" src="'+img+'bar/bxg.gif" width="'+p_expf+'%" ></td><td width="3" height="13"><img src="'+img+'bar/img_right.gif" width="3" height="13"></td></table></td>');
	f.write('<td><b><span onmouseover="parent.textboard_view('+desc_id[9]+',event)" onmouseout="parent.textboard_close()">'+t_name+'</span></b></td><td><img src="'+pic+'D9.gif" alt="稱號"></td></tr>');
	if(win_num>0)
	{
		f.write('<tr><td bgcolor="#666666" colspan="2">連勝紀錄</td><td colspan="4">'+win_num+' 連勝中</td></tr>')	
	}
	if(lastonline!=1)
	{
		f.write('<tr><td colspan="6"><table width="100%" height="100%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#333333"><tr><td>最近登入時間</td><td>'+lastonline+'</td></tr></table></td></tr>')	
	}
	f.write(temp_tebla2);
	f.write(hr);
	f.write(temp_tebla1);
	f.write('<br><tr><td width=10% bgcolor="#005581">力量</td><td class="b1" width=40%><img src="'+img+'bar/1.gif" width="'+p_strf+'%" height="9"></br><b>'+p_str+'</b></td>');
	f.write('<td width=10% bgcolor="#005581">智力</td><td class="b1" width=40%><img src="'+img+'bar/1.gif" width="'+p_smartf+'%" height="9"></br><b>'+p_smart+'</b></td></tr>')
	f.write('<tr><td width=10% bgcolor="#005581">敏捷</td><td class="b1" width=40%><img src="'+img+'bar/5.gif" width="'+p_aglf+'%" height="9"></br><b>'+p_agl+'</b></td>');
	f.write('<td width=10% bgcolor="#005581">生命</td><td class="b1" width=40%><img src="'+img+'bar/5.gif" width="'+p_lifef+'%" height="9"></br><b>'+p_life+'</b></td></tr>')
	f.write('<tr><td width=10% bgcolor="#005581">魅力</td><td class="b1" width=40%><img src="'+img+'bar/8.gif" width="'+p_auf+'%" height="9"></br><b>'+p_au+'</b></td>');
	f.write('<td width=10% bgcolor="#005581">信仰</td><td class="b1" width=40%><img src="'+img+'bar/8.gif" width="'+p_bef+'%" height="9"></br><b>'+p_be+'</b></td></tr>')
	f.write('<tr><td width=10% bgcolor="#005581">體質</td><td class="b1" width=40%><img src="'+img+'bar/8.gif" width="'+p_vitf+'%" height="9"></br><b>'+p_vit+'</b></td>');
	f.write('<td width=10% bgcolor="#005581">運氣</td><td class="b1" width=40%><b>???</b></td></tr>')
	f.write('<tr><td width=10% bgcolor="#005581">物攻</td><td class="b1" width=40%><img src="'+img+'bar/2.gif" width="'+p_atf+'%" height="9"></br><b>'+p_at+'</b></td>');
	f.write('<td width=10% bgcolor="#005581">魔攻</td><td class="b1" width=40%><img src="'+img+'bar/2.gif" width="'+p_matf+'%" height="9"></br><b>'+p_mat+'</b></td></tr>')
	f.write('<tr><td width=10% bgcolor="#005581">物防</td><td class="b1" width=40%><img src="'+img+'bar/9.gif" width="'+p_dff+'%" height="9"></br><b>'+p_df+'</b></td>');
	f.write('<td width=10% bgcolor="#005581">魔防</td><td class="b1" width=40%><img src="'+img+'bar/9.gif" width="'+p_mdff+'%" height="9"></br><b>'+p_mdf+'</b></td></tr>')
	f.write(temp_tebla2);
}
function no_cp(del_day,f_time)
{
	message_cls();
	var f=parent.wog_view.document;
	f.write('<table border=0 width="100%">');
	f.write('<tr>');
	f.write('<td valign="top">');
	chara_make(del_day,f_time);
	f.write('</td>');
	f.write('</tr>');
	f.write('</table>');
}
function s_status(s)
{
	switch(s)
	{
		case "1":
		 s="地";
		break;
		case "2":
		 s="水";
		break;
		case "3":
		 s="火";
		break;
		case "4":
		 s="木";
		break;
		case "5":
		 s="風";
		break;
		case "6":
		 s="毒";
		break;
		case "7":
		 s="無";
		break;
	}
	return s;
}
function get_f(p,s)
{
	p=(p/s)*100;
	if(p>100){p=100;}
	return p;
}
function chara_make(del_day,f_time)
{
	var f=parent.wog_view.document;
	f.write('<form action="wog_act.php" method="POST" target="wog_view">');
	f.write('<OL>');
	f.write('Fate Wog 遊戲方式<font color="#FF0000">↓ 看完遊戲說明再創造角色 ↓</font><br><br>');
	f.write('<LI>首先加入本站為<a href="javascript:window.external.AddFavorite(\'http://swtkzone.com/wog/\',\'『 緣 份 小 築 』 - Fate Wog｜自 由 緣 份\')"><font color="#ff0066">「我的最愛」</font></a>，再看<font color="#FFFF33">「玩家須知」</font>');
	f.write('<LI>瞭解後請點選下方「創作新角色」按鈕，註冊新角色');
	f.write('<LI>註冊後，可利用設定的帳號和密碼進入遊戲');
	f.write('<LI>在個人專屬舞台裡，可以進行動作選擇');
	f.write('<LI>註冊後，請看<font color="#FF00FF">「遊戲規則」</font>，<font color="#00ccff">「FAQ」</font>瞭解情況');
	f.write('<LI>每人只能創造 <FONT COLOR="#FF0000"><b>3</b></FONT> 位角色');
	f.write('<LI>每場戰役須等 <FONT COLOR="#FF0000"><b>'+f_time+'</b></FONT> 秒才可進行');
	f.write('<LI>帳號超過 <FONT COLOR="#FF0000"><b>365</b></FONT> 天沒上線就會被系統吃掉');
	f.write('<LI>帳號封鎖超過 <FONT COLOR="#FF0000"><b>60</b></FONT> 天沒上線就會被系統吃掉');
	f.write('<LI>管理團隊名單，遊戲經驗及金錢狀況請留意系統資訊');
	f.write('<br>歡迎最新玩家：<font color=yellow>'+new_player+'</font>，現在玩家總數：<font color=yellow>'+player_num+'</font>');
	f.write('<br>如遊戲出現異狀，請在 論壇 留言 或 MSN 尋找本人！');
	f.write('<INPUT TYPE="hidden" NAME="act" VALUE="make">');
	f.write('<INPUT TYPE="hidden" NAME="f" VALUE="chara">');
	f.write('<br>＊請按一下-><img src="'+img+'/logo/g018.gif"><INPUT TYPE="submit" VALUE=" 創造新角色 " ><img src="'+img+'/logo/g018.gif"></form>');
	f.write('</OL>');
}
function system(a,b,c,d,e,g) 
{ 
	var f=parent.wog_view.document;
	message_cls(); 
	var now_time=new Date();
	f.write('<table width="50%" border="1" cellspacing="0" cellpadding="2" align="center" bordercolor="#4B689E">');
	f.write('<form action="wog_etc.php" target="mission">'); 
	f.write('<tr><td colspan="2" bgcolor="#4B689E">Fate Wog 系 統 資 訊</td></tr>'); 
	f.write('<tr><td width="50%">最新版本：'+a+'</td><td width="50%">開站時間：2005年12月</td></tr>');
	f.write('<tr><td width="50%">目前版本：20120124</td><td width="50%">運行狀態：正常運作中</td></tr>');
	f.write('<tr><td colspan="2">版本不乎請自行按<font color="#00EE00">「F5」</font>按鈕更新，重新整理後即可！</td></tr>');
	f.write('<tr><td colspan="2" bgcolor="#4B689E">現 時 狀 態</td></tr>'); 
	(b>100)?b='<font color="yellow">'+b+'</font>':b=''+b+'';
	(c>100)?c='<font color="yellow">'+c+'</font>':c=''+c+'';
	f.write('<tr><td width="50%">現時經驗：'+b+' %</td><td width="50%">現時金錢：'+c+' %</td></tr>');
	f.write(temp_tebla2);
	f.write('<table width="50%" border="1" cellspacing="0" cellpadding="2" align="center" bordercolor="#4B689E">');
	f.write('<tr><td colspan="2" bgcolor="#4B689E">管 理 團 隊</td></tr>');
	f.write('<tr><td width="20%"><font color="yellow">站長</font></td><td><div align="left"><font color="#CCFFF">'+d+'</font></div></td></tr>');
	f.write('<tr><td width="20%"><font color="yellow">SGM</font></td><td><div align="left"><font color="#FF9933">'+e+'</font></div></td></tr>');
	f.write('<tr><td width="20%"><font color="yellow">GM</font></tb><td><div align="left"><font color="#33FF33">'+g+'</font></div></td></tr>');
	f.write('<tr><td colspan="2" bgcolor="#4B689E">其 他 項 目</td></tr>');
	f.write('<tr><td colspan="2">｜<a href="http://swtkzone.com/" target="_blank"><font color="#99FF00">【緣份小築】</font></a>｜<a href="http://swtkzone.com/thread-42-1-1.html" target="_blank"><font color="#CCCC33">【遊戲規則】</font></a>｜<a href="http://swtkzone.com/wog/wog_faq.htm" target="_blank"><font color="#66FFFF">【FAQ】</font></a>｜</td></tr>');
	f.write('<tr><td colspan="2" bgcolor="#4B689E">聯 絡 我 們</td></tr>');
	f.write('<tr><td colspan="2"><OL>');
	f.write('<LI><div align="left">ＭＳＮ：Fate_Wog@live.hk</div>');
	f.write('<LI><div align="left">論壇：<a href="http://swtkzone.com/pm.php?action=new&uid=1" target="_blank">發短信息給。恨緣〞</a>（需要成為論壇會員）</div>');
	f.write('<LI><div align="left">遊戲：於遊戲中尋找 斬星 詢問</div>');
	f.write('</OL></td></tr>'); 
	f.write('</form>'); 
	f.write(temp_tebla2);
} 
function newplay_see()
{
	var f=parent.wog_view.document;
	message_cls();
	f.write(fight_temp_tebla1);
	f.write('<tr><td><font size=5 color=FF0000><b>新玩家注意事項</b></font></td></tr>');
	f.write('<tr><td><font color=yellow>如果閣下的名稱有任何<b><font size=4>符號</font></b>請立即重新註冊，為免被鎖帳號！</font></td></tr>');
	f.write('<tr><td>首先，歡迎閣下加入我們的大家庭 <font color="#FFFF00">FATE WOG</font>。</td></tr>');
	f.write('<tr><td>通常新玩家在遊戲上都有遇到問題，希望玩家自己先找問題的解決方法，找不到才找其他人幫手。</td></tr>');
	f.write('<tr><td>尋找答案的地方：<a href="http://swtkzone.com/forum-34-1.html"><font color="#00FF00">Fate Forum</font></a></td></tr>');
	f.write('<tr><td><strong><font color="#00FFFF">攻略</font></strong>：<a href="http://swtkzone.com/thread-4810-1-1.html">http://swtkzone.com/thread-4810-1-1.html</a></td></tr>');
	f.write('<tr><td><strong><font color="#00FFFF">幫助</font></strong>：<a href="http://swtkzone.com/wog/wog_faq.htm">http://swtkzone.com/wog/wog_faq.htm</a></td></tr>');
	f.write('<tr><td>以上兩個網站應該能夠幫你解決很多問題</td></tr>');
	f.write(temp_tebla2);
	f.write('<br>'+fight_temp_tebla1);
	f.write('<tr><td><font size=5 color=FF0000><b>請各位玩家遵守遊戲規則</b></font></td></tr>');
	f.write('<tr><td>網站介紹：<a href="http://swtkzone.com/thread-42-1-1.html"><font color="#FF00FF">「遊戲規則」</font></a>，<a href="http://swtkzone.com/wog/read.htm"><font color="#FFFF33">「玩家須知」</font></a></td></tr>');
	f.write('<tr><td>如果玩家犯了以上其中一項規則，將可能被管理團體封鎖或禁言閣下帳號，請三思而後行！</td></tr>');
	f.write('<tr><td><font size=3 color=FF0000>嚴禁火星文，注音文，併音文等文字！（視嚴重性而定）</font></td></tr>');
	f.write('<tr><td>到此表示閣下已閱以上注意事項，希望閣下愉快地進行遊戲！</td></tr>');
	f.write('<tr><td><input type="button" value="我已經細閱以上各項需知，進入遊戲！" onClick="parent.act_click(\'chara\',\'status_view\')"></td></tr>');
	f.write(temp_tebla2);
}

function king_view(sname,s)
{
	var f=parent.wog_view.document;
	f.write(temp_tebla1);
	f.write('<tr><td height="0" colspan="3" rowspan="0" >'+sname+'</td></tr>')
	var s1=s.split(";");
	for(var i=0;i<s1.length;i++)
	{	
		var s2=s1[i].split(",");
		var p_img_url=s2[0];
		if(p_img_url.indexOf("http") == -1)
		{
			p_img_url='<img src="'+img+p_img_url+'.gif" border="0">';
		}else
		{
			p_img_url='<img src="'+p_img_url+'" border="0">';
		}
		f.write('<tr><td  width="110">'+p_img_url+'</td><td >'+s2[1]+'</td><td >'+s2[2]+'</td></tr>');
	}
	f.write(temp_tebla2);
}
function mr_view(s,adm) 
{ 
   message_cls(); 
   var f=parent.wog_view.document; 
   group_choose('13');
   var adm_mode=""; 
   var border_w="70%"; 
   if(adm==1){adm_mode="<td>選 項</td>";border_w="60%";} 
   f.write(temp_tebla1); 
   f.write('<br><tr bgcolor="#4B689E"><td width='+border_w+'>會 款 紀 錄</td><td width=30%>時 間</td>'+adm_mode+'</tr>'); 
   if(s) 
   { 
      var s1=s.split(";"); 
      for(var i=0;i<s1.length;i++) 
      { 
         var s2=s1[i].split(","); 
         if(adm==1){f.write('<tr><td  width='+border_w+'>'+s2[1]+'</td><td>'+s2[2]+'</td><td width=10%><input type=button value="予 許" onClick="parent.act_click(\'group\',\'mr_end\','+s2[0]+',1)"><input type=button value="刪 除" onClick="parent.act_click(\'group\',\'mr_end\','+s2[0]+',0)"></td></tr>');} 
         else{f.write('<tr><td  width='+border_w+'>'+s2[1]+'</td><td>'+s2[2]+'</td></tr>');} 
      } 
   }else 
   { 
      f.write('<tr><td  width='+border_w+' colspan=3>無 任 何 紀 錄</td></tr>');
   } 
   f.write(temp_tebla2); 
}
function system_view(s,instmsg)
{
	message_cls();
	var f=parent.wog_view.document; 
	if(instmsg != 0) 
	{ 
	f.write(temp_tebla1);
	f.write('<tr><td colspan="2" bgcolor="#4B689E">即時訊息</td></tr>'); 
	f.write('<tr><td width="65%">內容</td><td width="35%">發生時間</td></tr>'); 
	if(wog_log.length > 0) 
	{ 
		for(var i=wog_log.length-1;i >= 0;i--) 
		{ 
			var s2=wog_log[i].split(","); 
			f.write('<tr><td>'+s2[0]+'</td><td>'+s2[1]+'</td></tr>'); 
		} 
	}else 
	{ 
		f.write('<tr><td colspan="8" >尚未紀錄任何訊息</td></tr>');    
	} 
	f.write('<tr><td colspan="2"><font color="#BBBBBB">訊息內容將於遊戲結束時清除</font></td></tr>'); 
	f.write(temp_tebla2); 
	f.write(hr); 
	}
	f.write(temp_tebla1); 
	f.write('<br><tr bgcolor=#5f5f5f><td colspan=8>玩家訊息</td></tr>'); 
	f.write('<tr valign=top>');
	if(s!="") 
	{ 
		var top_name=""; 
		for(var a=1;a<=2;a++) 
		{ 
			(a==1)?top_name="接收":top_name="傳送"; 
			f.write('<td width=50%><table width="100%" border="1" cellspacing="0" cellpadding="2" align="center" bordercolor="#4B689E">'); 
			f.write('<tr><td colspan=2>'+top_name+'訊息</td></tr>'); 
			f.write('<tr><td width=65%>內容</td><td width=35%>發生時間</td></tr>'); 
			var s1=s.split(";"); 
			for(var i=0;i<s1.length;i++) 
			{ 
				var s2=s1[i].split(","); 
				if(s2[2]==a) 
				{ 
					f.write('<tr><td>'+s2[0]+'</td><td>'+s2[1]+'</td></tr>'); 
				} 
			} 
			f.write(temp_tebla2); 
		} 
	}else 
	{ 
		f.write('</tr><tr><td colspan="8" >尚未發生任何事件</td></tr>');    
	} 
	f.write(temp_tebla2);
}
function wog_log_save(s) 
{ 
   if(wog_log.length >= 10) 
   { 
      wog_log.shift(); 
   } 
   var time = new Date(); 
   var year=time.getFullYear(); 
   var month=time.getMonth()+1; 
   var day=time.getDate(); 
   var hour=time.getHours(); 
   var minute=time.getMinutes(); 
   var cut=''; 
   if(hour < 12) 
   { 
      cut='am'; 
   } 
   else 
   { 
      hour-=12; 
      cut='pm'; 
   } 
   if(month < 10)month='0'+month; 
   if(day < 10)day='0'+day; 
   if(hour < 10)hour='0'+hour; 
   if(minute < 10)minute='0'+minute; 
   var time_get = year+'/'+month+'/'+day+' '+hour+':'+minute+' '+cut; 
   wog_log.push(s+','+time_get); 
}
function group_news_view(s) 
{ 
   message_cls(); 
   var f=parent.wog_view.document; 
   group_choose('12');
   f.write(temp_tebla1); 
   f.write('<br><tr bgcolor="#4B689E"><td>內容</td><td>發生時間</td></tr>'); 
   if(s!="") 
   { 
      var s1=s.split(";"); 
      for(var i=0;i<s1.length;i++) 
      {    
         var s2=s1[i].split(","); 
         f.write('<tr><td>'+s2[0]+'</td><td>'+s2[1]+'</td></tr>'); 
      } 
   }else 
   { 
      f.write('<tr><td colspan="8" >尚未發生任何事件</td></tr>');    
   } 
    f.write('<tr><td colspan="2"><input type="button" value="清除所有訊息" onClick="parent.foot_turn(\'message\',3)"></td></tr>');
    f.write(temp_tebla2); 
}
//##### bank #####
function bank(a,b,c,d,a1)
{
	message_cls();
	a1='';
	var f=parent.wog_view.document;
	var bank_depot_menu='<tr><td colspan="2" bgcolor="#4B689E">銀 行 中 心</td></tr><tr><td><input type="button" value="銀行" onclick="parent.act_click(\'bank\',\'view\')" '+(a1==''?'disabled':'')+'> <input type="button" value="武器" onclick="parent.act_click(\'arm\',\'depot_list\',\'0\')" '+(a1=='0'?'disabled':'')+'> <input type="button" value="頭部" onclick="parent.act_click(\'arm\',\'depot_list\',\'1\')" '+(a1=='1'?'disabled':'')+'> <input type="button" value="身體" onclick="parent.act_click(\'arm\',\'depot_list\',\'2\')" '+(a1=='2'?'disabled':'')+'> <input type="button" value="手部" onclick="parent.act_click(\'arm\',\'depot_list\',\'3\')" '+(a1=='3'?'disabled':'')+'> <input type="button" value="腳部" onclick="parent.act_click(\'arm\',\'depot_list\',\'4\')" '+(a1=='4'?'disabled':'')+'> <input type="button" value="道具" onclick="parent.act_click(\'arm\',\'depot_list\',\'5\')" '+(a1=='5'?'disabled':'')+'> <input type="button" value="特殊" onclick="parent.act_click(\'arm\',\'depot_list\',\'6\')" '+(a1=='6'?'disabled':'')+'> <input type="button" value="座騎" onclick="parent.act_click(\'arm\',\'depot_list\',\'7\')" '+(a1=='7'?'disabled':'')+'> <input type="button" value="精靈" onclick="parent.act_click(\'arm\',\'depot_list\',\'8\')" '+(a1=='8'?'disabled':'')+'> <input type="button" value="稱號" onclick="parent.act_click(\'arm\',\'depot_list\',\'9\')" '+(a1=='9'?'disabled':'')+'> <input type="button" value="符咒" onclick="parent.act_click(\'arm\',\'depot_list\',\'10\')" '+(a1=='10'?'disabled':'')+'></td></tr>';
	f.write(temp_tebla1+bank_depot_menu+temp_tebla2);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write(temp_tebla1);
	f.write('<tr><td  >身上現金：'+a+'</td><td >銀行存款：'+b+'</td></tr>')
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<tr><td  >金額：<input type="text" name="money" size="20" maxlength="15"></td><td ><input type="submit" value="存 款"></td></tr>')
	f.write('<input type="hidden" name="f" value="bank">');
	f.write('<input type="hidden" name="act" value="save">');
	f.write('</form>');
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<tr><td  >金額：<input type="text" name="money" size="20" maxlength="15"></td><td ><input type="submit" value="提 款"></td></tr>')
	f.write('<input type="hidden" name="f" value="bank">');
	f.write('<input type="hidden" name="act" value="get">');
	f.write('</form>');
	f.write('<form name=f1>');
	f.write('<tr><td  >對像帳號：<input type="text" name="pay_id" size="10" maxlength="9"> - 金額：<input type="text" name="money" size="20" maxlength="15"></td><td ><input type="button" value="轉 帳" onclick="parent.foot_turn(\'bank\',\'pay\',document.f1.pay_id.value,document.f1.money.value,null)"></td></tr>')
	f.write('</form>');
	f.write('<tr><td colspan=2>利率 : '+c+'%</td></tr>'); 
   d=parseInt(d); 
   var e=""; 
   e+=(Math.floor(d/31536000)!=0)?Math.floor(d/31536000)+"年":""; 
   d=d%31536000; 
   e+=(Math.floor(d/86400)!=0)?Math.floor(d/86400)+"日":""; 
   d=d%86400; 
   e+=(Math.floor(d/3600)!=0)?Math.floor(d/3600)+"小時":""; 
   d=d%3600; 
   e+=(Math.floor(d/60)!=0)?Math.floor(d/60)+"分":""; 
   d=d%60; 
   e+=Math.floor(d/1)+"秒"; 
   f.write('<tr><td colspan=2>距離下次記息時間 : '+e+'</td></tr>');
   f.write('<tr><td colspan=2>注意：身家大於 200 億和 30 天未上線者將不會得到利息</td></tr>');
	f.write(temp_tebla2);
}
//#### arm begin ####
function arm_view(a,d,temp_id,bag,b)
{
	var f=parent.wog_view.document;
	vData=d;
	var s1=a.split(";");
	var splitnum = 10;
	var usepager = parseInt(Gookie('wog_arm_pager'), 10)  == 1;
	message_cls();
    f.write('<form action="wog_act.php" method="post" target="mission" name=f1 >');
    arm_link();
    f.write('<br>'+temp_tebla1);
    f.write('<thead>');
    if(d!="0")
	{
		f.write('<tr><td colspan="12" id="pager-box"></td></tr>');
	}
    if(temp_id != 'd_state_id')
	{
		f.write('<tr bgcolor="#4B689E"> <td>NO</td><td>選擇</td><td>物攻</td><td>魔攻</td><td>物防</td><td>魔防</td><td>速度</td><td>運氣</td><td>職業</td><td>能力限制</td><td>名稱</td><td>價格</td></tr>');
	}else{
		f.write('<tr bgcolor="#4B689E"> <td width="5%">NO</td><td width="5%">選擇</td><td width="45%">狀態效果</td><td width="10%">有效時間</td><td width="15%">能力限制</td><td width="10%">名稱</td><td width="10%">價格</td></tr>');
	}
	f.write('</thead>');
	var pagenum = 0;
	var n=0;
	var c=0;
	var str = '';
	if(d!="0")
	{
		for(var i=0;i<s1.length;i++)
		{
			var s2=s1[i].split(",");
			var temps=srhCount(s2[0]);
			var s3=null;
			if(tmpNum != "")
			{
				s3=tmpNum.split(",");
			}
			for(var j=0;j<temps;j++, ++n)
			{
				c++;
				var temp_num=s3!=null?"*"+s3[j]:"";
				var arm_view_color=s2[12]=="1"?"bgcolor="+nosend:"";
				var mlv=s2[15]!="0"?"("+s2[15]+" LV)":"";
				var time=s2[19]=="-1"?"--":+s2[19]+"分鐘";
				dc_name=s2[18]=="6"?"<font color=#32cd32>"+s2[5]+"</font>":s2[5];
				var seeatt="";
				if(s2[16].length>0)
				{
					while(s2[16].indexOf("&n") > 0) 
					{ 
						s2[16]=s2[16].replace("&n","\r\n"); 
					}
					seeatt="<img src='"+img+"icon3.gif' alt='"+s2[16]+"'>";
				}
				if(n%splitnum == 0) str += '<tbody id="page-'+(pagenum++)+'">';
				if (temp_id != 'd_state_id')
				{
					 str += '<tr '+arm_view_color+' onMouseOver="this.style.backgroundColor=\'#0000CD\'" onMouseOut="this.style.backgroundColor=\'\'" onclick="parent.setRadioValue(\'adds\',\''+s2[0]+','+s2[5]+'\')" style="cursor:hand"> <td>'+c+'</td> <td><input type="radio" name="adds" value="'+s2[0]+','+s2[5]+'"></td><td>'+s2[6]+'</td><td>'+s2[7]+'</td><td>'+s2[1]+'</td><td>'+s2[2]+'</td><td>'+s2[3]+'</td><td>'+s2[14]+'</td><td>'+s2[11]+'</td><td>力:'+s2[8]+' 速:'+s2[9]+' 智:'+s2[10]+' '+mlv+'</td><td><a href="javascript:parent.foot_turn(\'arm\',\'check_item\','+s2[0]+')">'+dc_name+'</a>'+temp_num+''+seeatt+'</td><td>'+s2[4]+'</td></tr>';
				}else{
					 str += '<tr '+arm_view_color+' onMouseOver="this.style.backgroundColor=\'#0000CD\'" onMouseOut="this.style.backgroundColor=\'\'" onclick="parent.setRadioValue(\'adds\',\''+s2[0]+','+s2[5]+'\')" style="cursor:hand"> <td>'+c+'</td> <td><input type="radio" name="adds" value="'+s2[0]+','+s2[5]+'"></td><td>'+s2[16]+'</td><td>'+time+'</td><td>力:'+s2[8]+' 速:'+s2[9]+' 智:'+s2[10]+' '+mlv+'</td><td>'+dc_name+temp_num+'</td><td>'+s2[4]+'</td></tr>';
				}
				if(n%splitnum == splitnum-1) str += '</tbody>\n';
			}
		}
		if(n%splitnum !== 0) str += '</tbody>';
		f.write(str);
	}else{
		f.write('<tr bgcolor="#2F4F4F"><td colspan="12">背包欄內沒有任何裝備</td></tr>');
	}
	if(b != "")
	{
		s2=b.split(",");
		var seeatt="";
		if(s2[8].length>0){
			while(s2[8].indexOf("&n") > 0) 
			{ 
				s2[8]=s2[8].replace("&n","\r\n"); 
			}
			seeatt="<img src='"+img+"icon3.gif' alt='"+s2[8]+"'>";
		}
		var arm_unsetup="";
		if (temp_id != 'd_state_id'){
		arm_unsetup = '<a href="javascript:parent.foot_turn(\'arm\',\'demount\',\''+temp_id+'\')">卸下</a>';
		f.write('<tr bgcolor="#777779"><td><font color="#FF0000">E</font></td><td>'+arm_unsetup+'</td><td>'+s2[0]+'</td><td>'+s2[1]+'</td><td>'+s2[2]+'</td><td>'+s2[3]+'</td><td>'+s2[4]+'</td><td>'+s2[5]+'</td><td>---</td><td>---</td><td><a href="javascript:parent.foot_turn(\'arm\',\'check_item\','+s2[9]+')">'+s2[6]+'</a>'+seeatt+'</td><td>---</td></tr>');
		}else{
		arm_unsetup = '<a href="javascript:parent.foot_turn(\'arm\',\'demount\',\''+temp_id+'\')">消除</a>';
		f.write('<tr bgcolor="#777779"><td><font color="#FF0000">E</font></td><td>'+arm_unsetup+'</td><td>'+s2[8]+'</td><td>---</td><td>---</td><td>'+s2[6]+'</td><td>---</td></tr>');
		}
	}
	f.write('<tr><td colspan="12" ><input type="submit" value="裝備">　<input type="button" value="轉移" onClick="parent.foot_turn (\'arm\',\'move\',document.f1.pay_id.value,document.f1.item_num.value,document.f1.adds)">　<input type="button" value="個人倉庫" onClick="parent.foot_turn (\'arm\',\'depot_add\',document.f1.pay_id.value,document.f1.item_num.value,document.f1.adds)">　<input type="button" value="貢獻公會" onClick="parent.foot_turn (\'group\',\'depot_add\',document.f1.pay_id.value,document.f1.item_num.value,document.f1.adds)">　<input type="button" value="拍賣" onClick="parent.sale_item(document.f1.adds,document.f1.item_num.value)">　<input type="button" value="販賣" onClick=if(confirm("確定賣出？")){parent.foot_turn(\'arm\',\'sale\',document.f1.pay_id.value,document.f1.item_num.value,document.f1.adds)}></td></tr>');
	if(temp_id !='d_item_id'){
	f.write('<tr><td colspan="12" >請選擇數量(1-99):<input type="text" name="item_num" size="2" maxlength="2" value="1" disabled="disabled">→非道具或特殊類數量限定為1</td></tr>');
	}else{
	f.write('<tr><td colspan="12" >請選擇數量(1-99):<input type="text" name="item_num" size="2" maxlength="2" value="1" >→裝備(特殊類/消耗品)，轉移，個人倉庫，貢獻公會，拍賣，販賣記得選擇道具數量</td></tr>');
	}
	f.write('<tr><td colspan="12" >欲轉移需輸入對方遊戲的帳號 <input type="text" name="pay_id" size="16"></td></tr>');
	f.write('<tr><td colspan="12" >已使用的背包格數 ：'+c+'/'+bag+' （可擴充至：275）</td></tr>');
	f.write('<tr><td colspan="12" >注意：<font color=#32cd32>綠色</font>名字的物品表示特殊類。玩家運氣到達1000時，運氣包將會服用無效！</td></tr>');
	f.write(temp_tebla2);
	f.write('<input type="hidden" name="f" value="arm">');	
	f.write('<input type="hidden" name="act" value="setup">');
	f.write('</form>');
	f.write('<span id="wog_message_box"></span>');
	if(d!="0")
	{
		var str = '';
		for(var i = 0, len = n/splitnum; i < len; ++i) {
			str += '<a href="javascript:parent.arm_show_page('+i+')">'+(i+1)+'</a> ';
		}
		f.getElementById('pager-box').innerHTML = '<input type="checkbox" value="1" onclick="parent.arm_toggle_pager(this.checked)"'+(usepager?'checked="checked"':'')+'/>'+str;
		arm_show_page(usepager? 0 : -1);
	}
}
function arm_toggle_pager(state) {
   Sookie('wog_arm_pager', state?"1":"0");
   arm_show_page(state? 0 : -1);
}

function arm_show_page(page) {
   //f1 > div > table > tbody+thead+tfoot
   var pagebody = parent.wog_view.document.f1.childNodes[2].childNodes;
   var usepager = parseInt(Gookie('wog_arm_pager'), 10) == 1;
   if(page < 0) {
      for(var i = 0, len = pagebody.length; i < len; ++i) {
         if(pagebody[i].id) pagebody[i].style.display = '';
      }
   } else if(usepager) {
      for(var i = 0, len = pagebody.length; i < len; ++i) {
         if(pagebody[i].id) pagebody[i].style.display = (pagebody[i].id == 'page-'+page)? '' :'none';
      }
   }
}
function arm_setup(a,b)
{
	switch(a)
	{
		case "a_id":
			d_a_name=b;
			return;
			break;
		case "d_head_id":
			d_head_name=b;
			return;
			break;
		case "d_body_id":
			d_body_name=b;
			return;
			break;
		case "d_hand_id":
			d_hand_name=b;
			return;
			break;
		case "d_foot_id":
			d_foot_name=b;
			return;
			break;
		case "d_item_id":
			d_item_name=b;
			return;
			break;
		case "d_ride_id":
			d_ride_name=b;
			return;
			break;
		case "d_spirit_id":
			d_spirit_name=b;
			return;
			break;
		case "d_title_id":
			d_title_name=b;
			return;
			break;
		case "d_state_id":
			d_state_name=b;
			return;
			break;
	}
	return;
}
function arm_end(s)
{
	var f=parent.wog_view.document;
	message_cls();
	f.write(temp_tebla1);
	if(s==1)
	{
		f.write('<tr><td>裝備完成</td></tr>')
	}
	if(s==2)
	{
		f.write('<tr><td>轉移完成</td></tr>')
	}
	f.write(temp_tebla2);
}
function srhCount(srhStr)
{
	var tmpData=vData.split(",");
	var tmpResult=0;
	tmpNum="";
	var tempvdata="";
	for(var i=0;i<tmpData.length;i++)
	{
		if(tmpData[i].indexOf("*") > 0)
		{
			var s1=tmpData[i].split("*");
			if(s1[0]==srhStr)
			{
				tmpResult=tmpResult+1;
				tmpNum=tmpNum+","+s1[1];
			}else
			{
				tempvdata=tempvdata+","+tmpData[i];
			}
		}else
		{
			if(tmpData[i]==srhStr)
			{
				tmpResult=tmpResult+1;
			}else
			{
				tempvdata=tempvdata+","+tmpData[i];
			}		
		}
	}
	vData=tempvdata.substr(1,tempvdata.length);
	if(tmpNum != "")
	{
		tmpNum=tmpNum.substr(1,tmpNum.length);
	}
	return tmpResult;
}
//##########----------syn_system_start----------########## 
function syn_view(a,d) 
{ 
	var f=parent.wog_view.document;
	vData=d;
	message_cls();
	arm_link();
	f.write(temp_tebla1);
	f.write('<form action="wog_act.php" method="post" target="mission" name=f1 >');
	f.write('<br><tr><td>合成選擇</td><td>物理攻擊力</td><td>魔力攻擊力</td><td>物理防禦力</td><td>魔力防禦力</td><td>提升速度</td><td>名稱</td><td>價格</td></tr>'); 
	if(a)
	{
	var s1=a.split(";"); 
	for(var i=0;i<s1.length;i++) 
	{    
		var s2=s1[i].split(","); 
		var temps=srhCount(s2[0]); 
		var s3=null;
		if(tmpNum != "")
		{
			s3=tmpNum.split(",");
		}
		for(var j=0;j<temps;j++) 
		{
			if(s3!=null)
			{
				var temp_num="*"+s3[j];
			}else
			{
				var temp_num="";
			}
			f.write('<tr><td><input type="checkbox" name="syn[]" value="'+s2[0]+'"></td><td>'+s2[6]+'</td><td>'+s2[7]+'</td><td>'+s2[1]+'</td><td>'+s2[2]+'</td><td>'+s2[3]+'</td><td>'+s2[5]+temp_num+'</td><td>'+s2[4]+'</td></tr>'); 
		} 
	} 
		f.write('<tr><td colspan="10" >選擇合成方式：<select name="syn_way">'); 
		var syn_option=new Array(); 
//		syn_option[0]="<option value=1 CHECKED>普通合成</option>"; 
//		syn_option[1]="<option value=2>隨機合成</option>"; 
		syn_option[0]="<option value=3>限定合成</option>"; 
		for(var a=0;a<syn_option.length;a++) 
		{ 
			f.write(syn_option[a]); 
		}
		f.write('</select></tr>'); 
		f.write('<tr><td colspan="10" ><input type="submit" value="送入合成爐"></tr>'); 
		f.write('<input type="hidden" name="f" value="syn">');    
		f.write('<input type="hidden" name="act" value="purify">'); 
		}else{
		f.write('<tr bgcolor="#777779"><td colspan="9">背包欄內沒有任何裝備</td></tr>');
		}
		f.write('</form>'); 
		f.write(temp_tebla2); 
} 
function syn_end(s,end,c) 
{ 
	var f=parent.wog_view.document; 
	message_cls(); 
	f.write(temp_tebla1); 
	f.write('<tr><td>在合成的途中合成爐突然發出閃閃的白光！<BR><p align=center><font size=7><b>轟隆隆隆隆隆隆隆隆隆隆！</b></p></font>'); 
	var timerID=setTimeout('syn_end_view("'+s+'","'+end+'","'+c+'")',1000); 
	f.write('</td></tr>'+temp_tebla2+"<br>"); 
} 
function syn_end_view(s,end,c) 
{ 
	var f=parent.wog_view.document; 
	f.write(temp_tebla1+'<tr><td>'); 
	if(end==1)//合成成功 
	{f.write('你的眼前出現了一樣金光閃閃的物品，這次的合成似乎是成功了！<br><br>合成結果： <font color=#ffffaf>'+s+'</font> 入手！');
	parent.wog_log_save('合成結果： '+s+' 入手！');} 
	if(end==2)//編號錯誤 
	{f.write('你合出了一團無法辨識的東西，或許是一團垃圾....');} 
	if(end==3)//合成失敗 
	{f.write('你的眼前出現了一團灰燼....。');} 
	if(end==4)//裝備過多 
	{f.write('合成成功！但因為裝備欄已滿，所以裝備掉下被不明人士撿走，請自認倒楣。');}
	if(end==5)//合成成功 
	{f.write('你的眼前出現了一樣金光閃閃的物品，這次的合成似乎是成功了！<br><br>合成結果： <font color=#ffffaf>'+s+'</font> 入手！');
	parent.wog_log_save('合成結果： '+s+' 入手！<br>狀態 <b>'+c+'</b> 消失');} 
	f.write('</td></tr>'+temp_tebla2); 
} 
function syn_ed(temp_s)
{
	var f=parent.wog_view.document;
	f.write(temp_tebla1+'<tr>');
	f.write('<td colspan="6" bgcolor="#4B689E">合 成 系 統</td></tr>');
	f.write('<tr><td '+(temp_s!="1"?changelink+' onClick="parent.act_click(\'syn\',\'list\')"':'bgcolor="#3366FF"')+'>合成大師</td>');
	f.write('<td '+(temp_s!="2"?changelink+' onClick="parent.act_click(\'synb\',\'list\')"':'bgcolor="#3366FF"')+'>神手合成</td></tr>');
	f.write('</tr>');
}
function syn_chose()
{
	var temp_s=Gookie("wog_syn_view");
	if(temp_s == null)
	{
		var temp_s='1';
	}
	switch(temp_s)
	{
		case '1':
			act_click('syn','list');
		break;
		case '2':
			act_click('synb','list');
		break;
	}
}
function syn_view_special(syntotal,page,s,type)
{
	Sookie("wog_syn_view","1")
	message_cls();
	syn_ed('1');
	var f=parent.wog_view.document;
	f.write('<form action="wog_act.php" method="post" name="pageform" target="mission">');
	//f.write(temp_tebla1);
	f.write('<tr><td colspan="13" class=b1>我是合成大師 , 專門替冒險者合成一般商店沒有販賣的物品 , 我的合成是要收費的 , 每樣物品手續費2000元 , 但是先提醒合成是有風險的。<br>我的師父愛德華是傳說中的合成天才 , 能合成稀有物品 , 目前他四處雲遊冒險 , 有緣您會遇到他<br>提示：得到 <b>匠王</b> 的祝福能夠在合成大師中100%合成成功</td></tr><tr bgcolor="#2B4686"><td colspan="13">');
	f.write(' <input type="button" value="武器區" onclick="parent.sel_type(\'0\')" '+(type=='0'?'disabled':'')+'> ');
	f.write(' <input type="button" value="頭盔區" onclick="parent.sel_type(\'1\')" '+(type=='1'?'disabled':'')+'> ');
	f.write(' <input type="button" value="護甲區" onclick="parent.sel_type(\'2\')" '+(type=='2'?'disabled':'')+'> ');
	f.write(' <input type="button" value="護手區" onclick="parent.sel_type(\'3\')" '+(type=='3'?'disabled':'')+'> ');
	f.write(' <input type="button" value="戰靴區" onclick="parent.sel_type(\'4\')" '+(type=='4'?'disabled':'')+'> ');
	f.write(' <input type="button" value="道具區" onclick="parent.sel_type(\'5\')" '+(type=='5'?'disabled':'')+'> ');
	f.write(' <input type="button" value="座騎區" onclick="parent.sel_type(\'7\')" '+(type=='7'?'disabled':'')+'> ');
	f.write(' <input type="button" value="精靈區" onclick="parent.sel_type(\'8\')" '+(type=='8'?'disabled':'')+'> ');
	f.write(' <input type="button" value="稱號區" onclick="parent.sel_type(\'9\')" '+(type=='9'?'disabled':'')+'> ');
	f.write(' <input type="button" value="符咒區" onclick="parent.sel_type(\'10\')" '+(type=='10'?'disabled':'')+'> ');
	f.write('</td></tr>');
	pagesplit(syntotal,page);
	f.write('<input type="hidden" name="page" value="1">');
	f.write('<input type="hidden" name="type" value="'+type+'">');
	f.write('<input type="hidden" name="f" value="syn">');
	f.write('<input type="hidden" name="act" value="list">');
	f.write('</form>');
	f.write(temp_tebla1);
	f.write('<form action="wog_act.php" method="post" target="mission" name=f1>');
	f.write('<tr><td colspan="13" bgcolor="#4B689E">請選擇想製作的物品</td></tr>');
	f.write('<tr bgcolor="#4B689E"><td>選擇</td><td>名稱</td><td>物攻</td><td>魔攻</td><td>物防</td><td>魔防</td><td>速度</td><td>運氣</td><td>職業</td><td>屬性</td><td>能力限制</td><td>限制熟練度</td></tr>');
	if(s!="")
	{
		var s1=s.split(";");
		for(var i=0;i<s1.length;i++)
		{
			var s2=s1[i].split(",");
			var arm_view_color=s2[13]=="1"?"bgcolor="+nosend:"";
			f.write('<tr '+arm_view_color+' onMouseOver="this.style.backgroundColor=\'#0000CD\'" onMouseOut="this.style.backgroundColor=\'\'" onclick="parent.setRadioValue(\'syn_id\','+s2[9]+');" style="cursor:hand">');
			var seeatt="";
			var mlv=s2[15]!="0"?"("+s2[15]+" LV)":"";
			if(s2[16].length>0)
			{
				while(s2[16].indexOf("&n") > 0) 
				{ 
					s2[16]=s2[16].replace("&n","\r\n"); 
				}
				seeatt="<img src='"+img+"icon3.gif' alt='"+s2[16]+"'>";
			}
			f.write('<td><input type="radio" name="syn_id" value="'+s2[9]+'"></td><td><a href="javascript:parent.act_click(\'syn\',\'detail\','+s2[9]+')">'+s2[0]+'</a>'+seeatt+'</td><td>'+s2[1]+'</td><td>'+s2[2]+'</td><td>'+s2[3]+'</td><td>'+s2[4]+'</td><td>'+s2[5]+'</td><td>'+s2[14]+'</td><td>'+s2[10]+'</td><td>'+s_status(s2[11])+'</td><td>力:'+s2[6]+' 速:'+s2[7]+' 智:'+s2[8]+' '+mlv+'</td><td>'+job_pro(s2[12])+'%</td></tr>');
		}
	}
	f.write('<tr><td colspan="12"><input type="submit" value="開 始 合 成"></td></tr>'); 
	f.write(temp_tebla2);
	f.write('<input type="hidden" name="f" value="syn">');    
	f.write('<input type="hidden" name="act" value="special">');
	f.write('</form>'); 	
	f.write('<span id="wog_message_box"></span>');
}
//##########----------syn_system_end----------##########
function synb_view_special(syntotal,page,s,type)
{
	Sookie("wog_syn_view","2")
	message_cls();
	syn_ed('2');
	var f=parent.wog_view.document;
	f.write('<form action="wog_act.php" method="post" name="pageform" target="mission">');
	//f.write(temp_tebla1);
	f.write('<tr><td colspan="13" class=b1>我是合成大師的師兄 - 神手合成 , 我流落多個異國 , 收集到很多合成方法 , 但難度十分高。<br>我的合成是要收費的 , 每樣物品手續費一億元 , 不論合成成功或失敗。要看你個人運氣如何啦!?你敢試嗎!?<br>提示：得到 <b>匠神</b> 的祝福能夠在神手合成中100%合成成功</td></tr><tr bgcolor="#2B4686"><td colspan="13">');
	f.write(' <input type="button" value="武器區" onclick="parent.sel_type(\'0\')" '+(type=='0'?'disabled':'')+'> ');
	f.write(' <input type="button" value="頭盔區" onclick="parent.sel_type(\'1\')" '+(type=='1'?'disabled':'')+'> ');
	f.write(' <input type="button" value="護甲區" onclick="parent.sel_type(\'2\')" '+(type=='2'?'disabled':'')+'> ');
	f.write(' <input type="button" value="護手區" onclick="parent.sel_type(\'3\')" '+(type=='3'?'disabled':'')+'> ');
	f.write(' <input type="button" value="戰靴區" onclick="parent.sel_type(\'4\')" '+(type=='4'?'disabled':'')+'> ');
	f.write(' <input type="button" value="道具區" onclick="parent.sel_type(\'5\')" '+(type=='5'?'disabled':'')+'> ');
	f.write(' <input type="button" value="座騎區" onclick="parent.sel_type(\'7\')" '+(type=='7'?'disabled':'')+'> ');
	f.write(' <input type="button" value="精靈區" onclick="parent.sel_type(\'8\')" '+(type=='8'?'disabled':'')+'> ');
	f.write(' <input type="button" value="稱號區" onclick="parent.sel_type(\'9\')" '+(type=='9'?'disabled':'')+'> ');
	f.write(' <input type="button" value="符咒區" onclick="parent.sel_type(\'10\')" '+(type=='10'?'disabled':'')+'> ');
	f.write('</td></tr>');
	pagesplit(syntotal,page);
	f.write('<input type="hidden" name="page" value="1">');
	f.write('<input type="hidden" name="type" value="'+type+'">');
	f.write('<input type="hidden" name="f" value="synb">');
	f.write('<input type="hidden" name="act" value="list">');
	f.write('</form>');
	f.write(temp_tebla1);
	f.write('<form action="wog_act.php" method="post" target="mission" name=f1>');
	f.write('<tr><td colspan="13" bgcolor="#4B689E">請選擇想製作的物品</td></tr>');
	f.write('<tr bgcolor="#4B689E"><td>選擇</td><td>名稱</td><td>物攻</td><td>魔攻</td><td>物防</td><td>魔防</td><td>速度</td><td>運氣</td><td>職業</td><td>屬性</td><td>能力限制</td><td>限制熟練度</td></tr>');
	if(s!="")
	{
		var s1=s.split(";");
		for(var i=0;i<s1.length;i++)
		{
			var s2=s1[i].split(",");
			var arm_view_color=s2[13]=="1"?"bgcolor="+nosend:"";
			f.write('<tr '+arm_view_color+' onMouseOver="this.style.backgroundColor=\'#0000CD\'" onMouseOut="this.style.backgroundColor=\'\'" onclick="parent.setRadioValue(\'syn_id\','+s2[9]+');" style="cursor:hand">');
			var seeatt="";
			var mlv=s2[15]!="0"?"("+s2[15]+" LV)":"";
			if(s2[16].length>0)
			{
				while(s2[16].indexOf("&n") > 0) 
			{
				s2[16]=s2[16].replace("&n","\r\n"); 
			}
			seeatt="<img src='"+img+"icon3.gif' alt='"+s2[16]+"'>";
			}
			f.write('<td><input type="radio" name="syn_id" value="'+s2[9]+'"></td><td><a href="javascript:parent.act_click(\'synb\',\'detail\','+s2[9]+')">'+s2[0]+'</a>'+seeatt+'</td><td>'+s2[1]+'</td><td>'+s2[2]+'</td><td>'+s2[3]+'</td><td>'+s2[4]+'</td><td>'+s2[5]+'</td><td>'+s2[14]+'</td><td>'+s2[10]+'</td><td>'+s_status(s2[11])+'</td><td>力:'+s2[6]+' 速:'+s2[7]+' 智:'+s2[8]+' '+mlv+'</td><td>'+job_pro(s2[12])+'%</td></tr>');
		}
	}
	f.write('<tr><td colspan="12"><input type="submit" value="開 始 合 成"></td></tr>'); 
	f.write(temp_tebla2);
	f.write('<input type="hidden" name="f" value="synb">');
	f.write('<input type="hidden" name="act" value="special">');
	f.write('</form>');
	f.write('<span id="wog_message_box"></span>');
}
//##########----------synb_system_end----------##########
function arm_select()
{
	message_cls();
	var f=parent.wog_view.document;
	f.write('<form method="post" target="mission">');
	arm_link();
	f.write('</form>');
}
function arm_link()
{
	var f=parent.wog_view.document;
	f.write(temp_tebla1+'<tr>');
	f.write('<td '+changelink+' onClick="parent.act_click(\'arm\',\'view\',\'a_id\')"><img src="'+img+'shop/sword.jpg"><br>武器欄</td>');
	f.write('<td '+changelink+' onClick="parent.act_click(\'arm\',\'view\',\'d_head_id\')"><img src="'+img+'shop/head.jpg"><br>頭盔欄</td>');
	f.write('<td '+changelink+' onClick="parent.act_click(\'arm\',\'view\',\'d_body_id\')"><img src="'+img+'shop/body.jpg"><br>鎧甲欄</td>');
	f.write('<td '+changelink+' onClick="parent.act_click(\'arm\',\'view\',\'d_hand_id\')"><img src="'+img+'shop/hand.jpg"><br>護手欄</td>');
	f.write('<td '+changelink+' onClick="parent.act_click(\'arm\',\'view\',\'d_foot_id\')"><img src="'+img+'shop/foot.jpg"><br>戰靴欄</td>');
	f.write('<td '+changelink+' onClick="parent.act_click(\'arm\',\'view\',\'d_item_id\')"><img src="'+img+'shop/other.jpg"><br>道具欄</td>');
	f.write('<td '+changelink+' onClick="parent.act_click(\'arm\',\'view\',\'d_ride_id\')"><img src="'+img+'shop/car.jpg"><br>座騎欄</td>');
	f.write('<td '+changelink+' onClick="parent.act_click(\'arm\',\'view\',\'d_spirit_id\')"><img src="'+img+'shop/ride.jpg"><br>精靈欄</td>');
	f.write('<td '+changelink+' onClick="parent.act_click(\'arm\',\'view\',\'d_title_id\')"><img src="'+img+'shop/title.gif"><br>稱號欄</td>');
	f.write('<td '+changelink+' onClick="parent.act_click(\'arm\',\'view\',\'d_state_id\')"><img src="'+img+'shop/state.gif"><br>符咒欄</td>');
	f.write('</tr><tr>');
	f.write('<td '+changelink+' onClick="parent.act_click(\'syn\',\'view\',\'a_id\')">合成</td>');
	f.write('<td '+changelink+' onClick="parent.act_click(\'syn\',\'view\',\'d_head_id\')">合成</td>');
	f.write('<td '+changelink+' onClick="parent.act_click(\'syn\',\'view\',\'d_body_id\')">合成</td>');
	f.write('<td '+changelink+' onClick="parent.act_click(\'syn\',\'view\',\'d_hand_id\')">合成</td>');
	f.write('<td '+changelink+' onClick="parent.act_click(\'syn\',\'view\',\'d_foot_id\')">合成</td>');
	f.write('<td '+changelink+' onClick="parent.act_click(\'syn\',\'view\',\'d_item_id\')">合成</td>');
	f.write('<td '+changelink+' onClick="parent.act_click(\'syn\',\'view\',\'d_ride_id\')">合成</td>');
	f.write('<td '+changelink+' onClick="parent.act_click(\'syn\',\'view\',\'d_spirit_id\')">合成</td>');
	f.write('<td '+changelink+' onClick="parent.act_click(\'syn\',\'view\',\'d_title_id\')">合成</td>');
	f.write('<td '+changelink+' onClick="parent.act_click(\'syn\',\'view\',\'d_state_id\')">合成</td>');
	f.write('</tr>'+temp_tebla2+hr);
}
function depot_list(a,b,a1){
	message_cls();
	var f=parent.wog_view.document; 
	var bank_depot_menu='<tr><td colspan="2" bgcolor="#4B689E">我 的 倉 庫</td></tr><tr><td><input type="button" value="銀行" onclick="parent.act_click(\'bank\',\'view\')" '+(a1==''?'disabled':'')+'> <input type="button" value="武器" onclick="parent.act_click(\'arm\',\'depot_list\',\'0\')" '+(b=='0'?'disabled':'')+'> <input type="button" value="頭部" onclick="parent.act_click(\'arm\',\'depot_list\',\'1\')" '+(b=='1'?'disabled':'')+'> <input type="button" value="身體" onclick="parent.act_click(\'arm\',\'depot_list\',\'2\')" '+(b=='2'?'disabled':'')+'> <input type="button" value="手部" onclick="parent.act_click(\'arm\',\'depot_list\',\'3\')" '+(b=='3'?'disabled':'')+'> <input type="button" value="腳部" onclick="parent.act_click(\'arm\',\'depot_list\',\'4\')" '+(b=='4'?'disabled':'')+'> <input type="button" value="道具" onclick="parent.act_click(\'arm\',\'depot_list\',\'5\')" '+(b=='5'?'disabled':'')+'> <input type="button" value="特殊" onclick="parent.act_click(\'arm\',\'depot_list\',\'6\')" '+(b=='6'?'disabled':'')+'> <input type="button" value="座騎" onclick="parent.act_click(\'arm\',\'depot_list\',\'7\')" '+(b=='7'?'disabled':'')+'> <input type="button" value="精靈" onclick="parent.act_click(\'arm\',\'depot_list\',\'8\')" '+(b=='8'?'disabled':'')+'> <input type="button" value="稱號" onclick="parent.act_click(\'arm\',\'depot_list\',\'9\')" '+(b=='9'?'disabled':'')+'> <input type="button" value="符咒" onclick="parent.act_click(\'arm\',\'depot_list\',\'10\')" '+(b=='10'?'disabled':'')+'></td></tr>';
	f.write(temp_tebla1+bank_depot_menu+temp_tebla2);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write(temp_tebla1);
	f.write('<tr class="head_td" bgcolor="#4B689E"><td>物品名稱</td><td>物品名稱</td><td>物品名稱</td></tr>');
	var num=0;
	var dum='';
	if(a!="")
	{
		var s1=a.split(";");
		for(var i=0;i<s1.length;i++)
		{
			num++;
			var s2=s1[i].split(",");
			var arm_view_color=s2[3]=="1"?"bgcolor="+nosend:"";
			if((i+1)%3==1)
			{
				f.write('<tr>');
			}
			if(b==5 || b==6)
			{
				var dum='*'+s2[2]+'';
			}
			f.write('<td '+arm_view_color+' onMouseOver="this.style.backgroundColor=\'#0000CD\'" onMouseOut="this.style.backgroundColor=\'\'" onclick="parent.setRadioValue(\'id\','+s2[4]+');" style="cursor:hand" ><input type="radio" name="id" value="'+s2[4]+'" > <a href="javascript:parent.foot_turn(\'arm\',\'check_item\','+s2[0]+')">'+s2[1]+'</a>'+dum+'</td>');
			if((i+1)%3==0)
			{
				f.write('</tr>');
			}
		}
		f.write('<tr><td colspan="9" >帳號:<input type="text" name="pay_id" size="10" value="'+p_name+'"> , ');
		if(b==5 || b==6){
		f.write('請選擇數量(1-99):<input type="text" name="d_num" size="2" maxlength="2" value="1"> ');
		}else{
		f.write('請選擇數量(1-99):<input type="text" name="d_num" size="2" maxlength="2" value="1" disabled="disabled"> ');
		}
		f.write(' <input type="button" value="轉移" onClick="parent.foot_turn(\'arm\',\'depot_move\',this.form.pay_id.value,this.form.d_num.value,this.form.id)"> ('+num+'/'+a1+')</td></tr>');
	}
	f.write('<tr><td colspan="9" class=b1><ol><li>非道具或特殊類限制1次只能轉移1個</li><li>道具或特殊類每件物品最多放置999件</li></ol></td></tr>');
	f.write(temp_tebla2);
	f.write('</form>');
	f.write('<span id="wog_message_box"></span>');
}
//###### xmas_item ######
function xmas_item(s,end) 
{ 
	var f=parent.wog_view.document; 
	message_cls(); 
	f.write(temp_tebla1); 
	f.write('<tr><td><font size=3>念念咒語，寶箱開啟！！</font><br/><font size=5 color=yellow><b>！！！縫隙中射出耀眼的光芒！！！</b><br/><img src="'+pic+'open.jpg"></font>'); 
	var timerID=setTimeout('xmas_item_view("'+s+'","'+end+'")',1500); 
	f.write('</td></tr>'+temp_tebla2); 
} 
function xmas_item_view(s,end) 
{
	var f=parent.wog_view.document;
	var op="";
	var opimg="";
	if(end==1)
	{
		opimg="<img src='"+pic+"open4.jpg'>";
		op="寶箱竟然爆炸了！天呀！";
		parent.wog_log_save('寶箱爆炸了。');
	}
	if(end==2)
	{
		opimg="<img src='"+pic+"open1.jpg'>";
		op="恭喜獲得寶物"+s+"，太幸運嚕！";
		parent.wog_log_save('開啟寶箱獲得 '+s);
	}
	f.write('<br>'+temp_tebla1+'<tr><td><font size=5>'+op+'</font><br/>'+opimg+'</td></tr>'+temp_tebla2);
	parent.wog_view.scroll(0,f.body.scrollHeight);
	if(end==3)
	{
		var timerID=setTimeout('xmas_item_f("'+s+'")',1000);
	}
}
function xmas_item_f(s)
{
	var f=parent.wog_view.document;
	f.write(temp_tebla1+'<tr><td><font size=5>裝備欄已滿，眼睜睜的看著 '+s+' 被老天爺拿走。</font><br/><img src="'+pic+'open3.jpg"></td></tr>'+table_close1);
	parent.wog_log_save('裝備欄已滿，喪失裝備 '+s);
	parent.wog_view.scroll(0,f.body.scrollHeight);
}
//########## online peo begin ###########
function onlinelist(peo)
{
	var f=parent.wog_peo.document;
	message_cls(f,0);
	f.write(online_temp_tebla1);
	var boy=0;
	var girl=0;
	var idol=0;
	if(peo!="")
	{
		f.write('<tr bgcolor="#4169E1"><td >玩家名稱</td><td >等級</td><td>轉生</td><td >PK</td></tr>');
		var s1=peo.split(";");
		for(var temp_p=0;temp_p<sec.length;temp_p++)
		{
			var c=0; 
			for(var i=0;i<s1.length;i++)
			{	
				var s2=s1[i].split(",");
				if(s2[9] == "")s2[9]="PK金額 : "+s2[4];
				if(temp_p==s2[5])
				{
					c++; 
					var fcolor=psex(s2[1]);
					(s2[1]=="1")?boy++:girl++;
					(s2[3]==1)?s2[3]="Y":s2[3]="N";
					if(s2[8]>=7) 
					{
					f.write('<tr onMouseOver="parent.statusboard_view('+i+',event)" onMouseOut="parent.statusboard_close()"><td bgcolor="black"><a href=javascript:parent.yesname("'+s2[0]+'") target="foot"><font color="#33FF00">'+s2[0]+'</font></a></td><td bgcolor="black">'+s2[2]+'</td><td bgcolor="black">'+s2[6]+'</td><td bgcolor="black">'+s2[3]+'</td></tr>'); 
					showstatus[i]=s2[0]+','+s2[1]+','+s2[2]+','+s2[6]+','+s2[9]+','+s2[10]+','+s2[11]+','+s2[12]+','+s2[13]+','+s2[7];
					idol++;	
					}else{
					f.write('<tr onMouseOver="parent.statusboard_view('+i+',event)" onMouseOut="parent.statusboard_close()"><td bgcolor="black"><a href=javascript:parent.yesname("'+s2[0]+'") target="foot"><font color="'+fcolor+'">'+s2[0]+'</font></a></td><td bgcolor="black">'+s2[2]+'</td><td bgcolor="black">'+s2[6]+'</td><td bgcolor="black">'+s2[3]+'</td></tr>'); 
					showstatus[i]=s2[0]+','+s2[1]+','+s2[2]+','+s2[6]+','+s2[9]+','+s2[10]+','+s2[11]+','+s2[12]+','+s2[13]+','+s2[7];
					c++;
					}
				}
			}
			if(c>0 && temp_p!=0) 
			f.write('<tr><td colspan="4" bgcolor="black"><b>↑'+sec[temp_p]+'練功↑</b></td></tr>');
			if(c>0 && temp_p==0) 
            		f.write('<tr><td colspan="4" bgcolor="black"><b>↑'+sec[temp_p]+'發呆↑</b></td></tr>'); 
            		c=0; 
		}
		f.write('<tr><td bgcolor="black" colspan="4"><font color="#66ccff">男生</font> '+boy+' 人、<font color="#ff99cc">女生</font> '+girl+' 人</td></tr>');	
		f.write('<tr><td  bgcolor="black" colspan="4">在線 '+s1.length+' 人、<font color="#33FF00">發呆</font> '+idol+' 人</td></tr>');
	}else
	{
		f.write('<tr><td colspan="4" bgcolor="#4169E1">線上人數 0 人</td></tr>');
	}
	f.write('<tr bgcolor="black"><td colspan="4"><font color="#808080">Online FF Battle-<br/>Copyright(C) <a href="http://www.et99.org/" target="_blank">ETERNAL</a></font></td></tr>');
	f.write(temp_tebla2);
}
var showstatus=new Array(); 
function statusboard_view(txt_id,event) 
{ 
	var board=parent.wog_view.showboard; 
	var f=parent.wog_view.frameElement;
	var s1=showstatus[txt_id].split(","); //分割資料 
	var fcolor=psex(s1[1]);
	var showimg=(s1[7]==1)?s1[6]:img+s1[5]+'.gif';
	load_img(showimg,100,200);
	var statusheight=20;
	if(s1[4])
	{
		var scheck=s1[4].split("###");
		statusheight+=(scheck[0].length==0)?18:Math.ceil(scheck[0].length/14)*18;
		var i=1;
		while(s1[4].indexOf("###") > 0)
		{
			s1[4]=s1[4].replace("###","<br>");
			statusheight+=(scheck[i].length==0)?18:Math.ceil(scheck[i].length/14)*18;
			i++;
		}
	}else{
		s1[4]="無狀態";
	}
	if(height>statusheight)
	{
		var stheight=height+5;
	}else{
		var stheight=statusheight;
	}
	var seheight=height-20;
	board.innerHTML='<TABLE STYLE="background-image: url('+img+'W_hs03.gif); filter:Alpha(opacity=50);" BORDER=0 cellspacing=0 cellpadding=0 width="285" style="border:2px solid #4B689E font-size:9px;"><TR><TD width=100 rowspan="2"><img src="'+showimg+'" width="'+width+'" height="'+height+'" style="position:relative"></TD><TD width="185"><TABLE BORDER=0 cellspacing=0 cellpadding=0 width=185 height="100%" style="position:relative"><TR height="1"><TD bgcolor="#191970"></TD></TR><TR><TD bgcolor="#191970"><FONT COLOR="'+fcolor+'">'+s1[0]+'</FONT></TD></TR><TR height="1"><TD></TD></TR><TR height="'+seheight+'"><TD>'+s1[4]+'</TD></TR><TR height="1"><TD></TD></TR></TABLE></TABLE></TD></TR></TABLE>';
	var maxtop=(f.height<stheight)?f.height:stheight;
	var b_top=(event.clientY+(stheight-20)>f.height)?f.height-maxtop:event.clientY-20;
	board.style.left=f.width-310+parent.wog_view.document.body.scrollLeft; 
	board.style.top=b_top+parent.wog_view.document.body.scrollTop;
	board.style.display="";
} 
function statusboard_close() 
{ 
   parent.wog_view.showboard.style.display="none"; 
}
//########## no_online peo begin ###########
function no_onlinelist(peo)
{
	var f=parent.wog_peo.document;
	message_cls(f,0);
	f.write(online_temp_tebla1);
	f.write('<tr><td colspan="3"  bgcolor="#4B689E">2分鐘後自動更新</td></tr>');
	f.write(temp_tebla2);
}
function yesname(s)
{
	parent.foot.document.f1.towho.value=s;
}

function noname() {
	parent.foot.document.f1.towho.options[0].value='';
	parent.foot.document.f1.towho.options[0].text='';
}
function psex(s)
{
	if(s=="1")
	{
		return "#66ccff";
	}else
	{
		return "#ff99cc";
	}
}
//##### ect,job,pk ######
function job_view(s,b,c)
{
	message_cls();
	var f=parent.wog_view.document;
	f.write('<form action="wog_act.php" method="post" target="mission" name=f1 >');
	f.write(temp_tebla1);
	if(b != "")
	{
		f.write('<tr bgcolor="#4B689E"><td colspan="10" >正使用的奧義</td></tr>');
		s1=b.split(",");
		f.write('<tr><td colspan="10" >'+s1[0]+' 奧義</td></tr>');
		f.write('<tr bgcolor="#4B689E"><td colspan="5">自身能力所乘倍數</td><td colspan="5">敵人能力所乘倍數</td></tr>');
		f.write('<tr ><td>物攻</td><td>物防</td><td>魔攻</td><td>魔防</td><td>速度</td><td>物攻</td><td>物防</td><td>魔攻</td><td>魔防</td><td>速度</td></tr>');
		f.write('<tr><td>'+s1[1]+'</td><td>'+s1[2]+'</td><td>'+s1[3]+'</td><td>'+s1[4]+'</td><td>'+s1[5]+'</td><td>'+s1[6]+'</td><td>'+s1[7]+'</td><td>'+s1[8]+'</td><td>'+s1[9]+'</td><td>'+s1[10]+'</td></tr>');
		f.write('<tr><td colspan="5">戰後金錢所乘 1 倍</td><td colspan="5">恢復HP '+s1[11]+' ％</td></tr>');
		f.write('<tr><td colspan="5">命中率增加 '+s1[12]+' ％</td><td colspan="5">迴避率增加 '+s1[13]+' ％</td></tr>');
		f.write('<tr><td colspan="5">必殺技發動率增加 '+s1[14]+' ％</td><td colspan="5">增加連續攻擊 '+s1[15]+' 次</td></tr>');
		f.write(temp_tebla2+hr1);
	}
	f.write(temp_tebla1);
	//f.write('<tr bgcolor="#4B689E"><td>選擇</td><td>系別</td><td>名稱</td><td>力量</td><td>智慧</td><td>生命</td><td>體質</td><td>速度</td><td>魅力</td><td>信仰</td><td>潛能</td><td>熟練度</td></tr>')
	f.write('<tr bgcolor="#4B689E"><td>選擇</td><td>名稱</td><td>力量</td><td>智慧</td><td>生命</td><td>體質</td><td>速度</td><td>魅力</td><td>信仰</td> <td>熟練度</td></tr>')
	var s1=s.split(";");
	for(var i=0;i<s1.length;i++)
	{		
		var s2=s1[i].split("|");
		for(var j=0;j<(s2.length-1);j++)
		{
			s2[j]=s2[j].replace(",","-");
		}
		var eq_job="";
		if(s2[10]=="1")
		{
			eq_job="<font color=red>E</font>";
		} else {
			eq_job='<input type="radio" name="job_id" value="'+s2[0]+'">';
		}
		f.write('<tr onMouseOver="this.style.backgroundColor=\'#0000CD\'" onMouseOut="this.style.backgroundColor=\'\'" onclick="parent.setRadioValue(\'job_id\','+s2[0]+');" style="cursor:hand"><td>'+eq_job+'</td><td  ><a href="javascript:parent.foot_turn(\'job\',\'check_job\','+s2[0]+')">'+s2[1]+'</a></td><td  >'+s2[2]+'</td><td >'+s2[3]+'</td><td >'+s2[4]+'</td><td >'+s2[5]+'</td><td >'+s2[6]+'</td><td>'+s2[7]+'</td><td>'+s2[8]+'</td><td>'+job_pro(s2[9])+'%</td></tr>');
		//f.write('<tr onMouseOver="this.style.backgroundColor=\'#0000CD\'" onMouseOut="this.style.backgroundColor=\'\'" onclick="parent.setRadioValue(\'job_id\','+s2[0]+');" style="cursor:hand"><td>'+eq_job+'</td><td>'+s2[12]+'</td><td >'+s2[1]+'</td><td  >'+s2[2]+'</td><td >'+s2[3]+'</td><td >'+s2[4]+'</td><td >'+s2[5]+'</td><td >'+s2[6]+'</td><td>'+s2[7]+'</td><td>'+s2[8]+'</td><td>'+s2[11]+'</td><td>'+job_pro(s2[9])+'%</td></tr>');
}
	f.write('<tr><td colspan="12" ><input type="button" value="變更職業" onClick="parent.foot_turn(\'job\',\'setup\',null,null,document.f1.job_id)"> <input type="button" value="使用奧義" onClick="parent.foot_turn(\'job\',\'get_skill\',null,null,document.f1.job_id)"></td></tr>');
	f.write(temp_tebla2);
	f.write('</form>');
	f.write('<span id="wog_message_box"></span>');
}
function job_pro(s)
{
	s=parseInt(s);
	s=Math.floor((s/3500)*100);
	return s;
}
function job_end(a,message,type,item_id,item_num)
{
	var f=parent.wog_view.document;
	var s=new Array;
	s[0]="";
	s[1]="成功刪除";
	s[2]="轉職成功";
	s[3]="設定成功";
	s[4]="感謝您使用本銀行";
	s[5]="休息了一晚後, HP回復精神飽滿";
	s[6]="購買成功";
	s[7]="已成功寄出郵件";
	s[8]="成功取得以及裝備奧義";
	s[9]="開始拍賣";
	s[10]="建立成功";
	s[11]="改變成功";
	s[12]="出價成功";
	s[13]="已消除身上狀態";
	s[14]="手續完成,請等待核可";
	s[15]="手續完成";
	s[16]="過度疲勞寵物死亡";
	s[17]="寵物逃跑";
	s[18]="放生成功";
	s[19]="復活成功,經驗值下降1/5";
	s[20]="任務接受成功";
	s[21]="恭喜完成任務";
	s[22]="取消任務成功";
	s[23]="清除成功";
	s[24]="修改密碼成功";
	s[25]="更改聊天頭銜成功";
	s[27]="戰鬥設定成功";
	s[32]="您成功減去了一百場戰敗";
	s[36]="您成功減去了十場PK敗數";
	s[37]="轉移完成";
	s[38]="您成功修復好等待時間了";
	s[39]="轉運了!轉運了!希望是好運吧";
	s[40]="您修改EMAIL成功";
	s[41]="已被掉線，請於1分鐘後重登";
	s[42]="公會升級成功";
	s[43]="學習成功";
	s[44]="使用成功";
	/*
	if(a==2)
	{
		d_a_name="";d_body_name="";d_head_name="";d_hand_name="";d_foot_name="";d_item_name="";d_ride_name="";d_spirit_name="";d_title_name="";d_state_name="";
	}
	*/
	var temp = '';
	temp = temp_tebla1+'<tr bgcolor="#333333"><td >'+s[a]+'!!</td></tr>';
	if(message)
	{
		while(message.indexOf("&n") > 0)
		{
			message=message.replace("&n","<br>");
		}
		temp += '<tr><td class=b1>'+message+'</td></tr>';
	}
	temp +=temp_tebla2;
	if(!type)
	{
		message_cls();
		f.write(temp);
	}
	else
	{
		if(item_id!=null)
		{
			f.getElementById("show_message_"+item_id).innerHTML=item_num;
		}
		f.getElementById("show_message").innerHTML=temp;
	}
}
function pk_view(s,money,win,lost)
{
	message_cls();
	var f=parent.wog_view.document;
	if(s==1)
	{
		var pk_yes="checked";
		var pk_no="";
	}else
	{
		var pk_yes="";
		var pk_no="checked";	
	}
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write(temp_tebla1);
	f.write('<tr bgcolor="#4B689E"><td >參加PK</td><td >PK金額</td></tr>');
	f.write('<tr><td ><input type="radio" name="pk_setup" value="1" '+pk_yes+'>YES <input type="radio" name="pk_setup" value="0" '+pk_no+'>NO </td><td ><input type="text" name="pk_money" value="'+money+'" size="7" maxlength="7"></td></tr>');
	f.write('<tr><td colspan="2" ><input type="submit" value="確定"></td></tr>');
	f.write('<tr><td colspan="2" >PK戰果紀錄 : WIN '+win+' / LOST '+lost+'</td></tr>');
	f.write('<tr><td colspan="2" >PK金額設定最高100000最低1000,身上現金低於最低金額不能參加PK,系統會自動設定不參加PK賽</td></tr>');
	f.write(temp_tebla2);
	f.write('<input type="hidden" name="f" value="pk">');	
	f.write('<input type="hidden" name="act" value="setup">');
	f.write('</form>');
    f.write(hr+temp_tebla1); 
    f.write('<tr bgcolor="#4B689E"><td>更 改 狀 態</td></tr>'); 
	f.write('<tr><td><textarea name="p_status" rows="10" cols="70">'+p_status+'</textarea><br><center><input type="button" value="改變狀態" onclick="parent.act_click(\'store\',\'status_save\',p_status.value)"></center></td></tr>'); 
   f.write('<tr><td><font color="red">請勿輸入不雅文字，經查證將在【沒有警告】的情況下刪除該帳號</font></td></tr>'); 
   f.write(temp_tebla2);
}
function count_confirm(basic,str,smart,agl,life,au,be,vit)
{ 
   message_cls(); 
   var f=parent.wog_view.document; 
   f.write('<form method="POST" action="wog_act.php">'); 
   f.write('<INPUT TYPE="hidden" NAME="act" VALUE="count"><INPUT TYPE="hidden" NAME="f" VALUE="count">'); 
   f.write(temp_tebla1); 
   f.write('<tr><td colspan="6" bgcolor="#4B689E">分配玩家潛能</td></tr>');
   f.write('<tr><td colspan="6">玩家能力 - 剩餘「<font color="#FF0000"><b>'+basic+'</b></font>」點潛能</td></tr>');
   f.write('<tr><td bgcolor="#005581">力量</td><td>'+str+'</td><td><input type="text" size="8" maxlength="8" name="str" value="0"></td>');
   f.write('<td bgcolor="#005581">智力</td><td>'+smart+'</td><td><input type="text" size="8" maxlength="8" name="smart" value="0"></td></tr>');
   f.write('<tr><td bgcolor="#005581">敏捷</td><td>'+agl+'</td><td><input type="text" size="8" maxlength="8" name="agl" value="0"></td>');
   f.write('<td bgcolor="#005581">生命</td><td>'+life+'</td><td><input type="text" size="8" maxlength="8" name="life" value="0"></td></tr>');
   f.write('<tr><td bgcolor="#005581">魅力</td><td>'+au+'</td><td><input type="text" size="8" maxlength="8" name="au" value="0"></td>');
   f.write('<td bgcolor="#005581">信仰</td><td>'+be+'</td><td><input type="text" size="8" maxlength="8" name="be" value="0"></td></tr>');
   f.write('<tr><td bgcolor="#005581">體質</td><td>'+vit+'</td><td><input type="text" size="8" maxlength="8" name="vit" value="0"></td>');
   f.write('<td bgcolor="#005581">---</td><td>---</td><td>---</td></tr>');
   f.write('<tr><td colspan="3">增加 1 點力量會增加 2 點物理攻擊力</td>');
   f.write('<td colspan="3">增加 1 點智力會增加 2 點魔法攻擊力</td></tr>');
   f.write('<tr><td colspan="3">增加 1 點體質會增加 2 點物理防禦力</td>');
   f.write('<td colspan="3">增加 1 點信仰會增加 2 點魔法防禦力</td></tr>');
   f.write('<tr><td colspan="3">增加 1 點敏捷會增加 2 點速度</td>');
   f.write('<td colspan="3">增加 1 點生命會增加 5 點ＨＰ上限</td></tr>');
   f.write('<tr><td colspan="6" ><input type="submit" value="確 定 分 配"></td></tr>'); 
   f.write(temp_tebla2); 
   f.write('</form>');
}
function id_admin() 
{ 
   message_cls(); 
   var f=parent.wog_view.document; 
   f.write(temp_tebla1); 
   f.write('<form action="wog_act.php" method="post" target="mission">'); 
   f.write('<tr><td colspan="2" bgcolor="#4B689E">自 行 掉 線</td></tr>'); 
   f.write('<tr><td>↓名稱↓</td><td>↓密碼↓</td></tr>\n');     
   f.write('<tr><td><input type="text" size="12" maxlength="12" name="id"></td><td><input type="password" size="18" name="password"></td></tr>');    
   f.write('<tr><td colspan="2">帳號被卡在遊戲上？使用自行掉線功能可能幫到你。</td></tr>'); 
   f.write('<tr><td colspan="2" ><input type="submit" value="確 定 掉 線"></td></tr>');    
   f.write('<input type="hidden" name="f" value="loginout">\n'); 
   f.write('</form>');
   f.write('<tr><td colspan="2" height="10"></td></tr>'); //分隔線
   f.write('<form action="wog_act.php" method="post" target="mission">'); 
   f.write('<tr><td colspan="2" bgcolor="#4B689E">更 改 密 碼</td></tr>'); 
   f.write('<tr><td>↓名稱↓</td><td>舊密碼→<input type="password" size="18" name="password"></td></tr>\n');     
   f.write('<tr><td><input type="text" size="12" maxlength="12" name="id"></td><td>新密碼→<input type="password" size="18" name="new_password"></td></tr>');    
   f.write('<tr><td colspan="2" ><input type="submit" value="確 定 更 改"></td></tr>');    
   f.write('<input type="hidden" name="f" value="passchange">\n'); 
   f.write('</form>'); 
   f.write('<tr><td colspan="2" height="10"></td></tr>'); //分隔線
   f.write('<form action="wog_etc.php" target="mission">'); 
   f.write('<tr><td colspan="2" bgcolor="#4B689E">補 發 密 碼</td></tr>');
   f.write('<tr><td colspan="2" >EMAIL→<input type="text" size="25"  name="email"> (請輸入你註冊的EMAIL)　<input type="submit" value="送 出"></td></tr>');
   f.write('<input type="hidden" name="f" value="password">'); 
   f.write('</form>'); 
   f.write('<tr><td colspan="2" height="10"></td></tr>'); //分隔線
   f.write('<form action="wog_act.php" method="post" target="mission">'); 
   f.write('<tr><td colspan="2" bgcolor="#4B689E">更 改 EMAIL</td></tr>'); 
   f.write('<tr><td>名稱→<input type="text" size="12" name="id"></td><td>舊EMAIL→<input type="text" size="25" name="email"></td></tr>\n');     
   f.write('<tr><td>密碼→<input type="password" size="12" name="password"></td><td>新EMAIL→<input type="text" size="25" name="new_email"></td></tr>');    
   f.write('<tr><td colspan="2" ><input type="submit" value="確 定 更 改"></td></tr>');    
   f.write('<input type="hidden" name="f" value="email">\n'); 
   f.write('</form>'); 
   f.write('<tr><td colspan="2" height="10"></td></tr>'); //分隔線
   f.write('<form action="wog_act.php" method="post" target="mission">'); 
   f.write('<tr><td colspan="2" bgcolor="#4B689E">增加登入帳號 - 適用於未自定登入帳號的玩家〔接受英/數，字數限制 <font color="#FFFF00">14</font> 位〕</td></tr>'); 
   f.write('<tr><td>名稱→<input type="text" size="12" maxlength="12" name="id"></td><td>↓自定新的登入帳號↓</td></tr>\n');     
   f.write('<tr><td>密碼→<input type="password" size="12" name="password"></td><td><input type="text" size="12" maxlength="12" name="ac"></td></tr>');    
   f.write('<tr><td colspan="2" ><input type="submit" value="確 定 更 改"></td></tr>');    
   f.write('<input type="hidden" name="f" value="loginac">\n'); 
   f.write('</form>'); 
   /*
   f.write('<tr><td colspan="2" height="10"></td></tr>'); //分隔線
   f.write('<form action="wog_act.php" method="post" target="mission">'); 
   f.write('<tr><td colspan="2" bgcolor="#4B689E">角 色 自 殺</td></tr>'); 
   f.write('<tr><td >ＩＤ→<input type="text" size="12" maxlength="12" name="id" ></td><td >密碼→<input type="password" size="25" name="password"></td></tr>'); 
   f.write('<tr><td >名稱→<input type="text" size="12" maxlength="12" name="name" ></td><td >Email→<input type="text" size="25" name="email" ></td></tr>'); 
   f.write('<tr><td colspan="2" ><input type="submit" value="確 定 刪 帳"></td></tr>'); 
   f.write('<input type="hidden" name="f" value="chara">'); 
   f.write('<input type="hidden" name="act" value="kill">'); 
   f.write('</form>');
   */
   f.write(temp_tebla2); 
}
//####### act tool #########
function act_click(f,a,b,c)
{
	var thisfrom="";
	thisfrom=parent.foot.document.f1;
	thisfrom.act.value=a;
	thisfrom.f.value=f;
	thisfrom.temp_id.value=b;
thisfrom.temp_id2.value=c;
	thisfrom.action="wog_act.php";
	thisfrom.submit();
}
function foot_turn(a,b,c,d,e)
{
	var thisfrom=parent.foot.document.f1;
	var temp_s="";
	thisfrom.action="wog_act.php";
	thisfrom.temp_id2.value="";
	thisfrom.act.value="";
	thisfrom.f.value="";
	thisfrom.pay_id.value="";
	thisfrom.temp_id.value="";
	thisfrom.act.value=b;
	thisfrom.f.value=a;
	thisfrom.pay_id.value=c;
	thisfrom.temp_id.value=d;
//	alert(thisfrom.temp_id.value);
	if(e!=null)
	{
		if(e.length!=undefined)
		{
			for(var i=0;i<e.length;i++)
			{
				if(e[i].checked==true)
				{
					temp_s+=","+e[i].value;
				}			
			}
			temp_s=temp_s.substr(1,temp_s.length);
		}else
		{
			temp_s=e.value;
		}
		thisfrom.temp_id2.value=temp_s;
	}
	thisfrom.submit();
}
function foot_turn2(a,b,c,d,e,f,g,h,i)
{
	var thisfrom=parent.foot.document.f1;
	thisfrom.action="wog_act.php";
	thisfrom.f.value="";
	thisfrom.act.value="";
	thisfrom.item_id.value="";
	thisfrom.money.value="";
	thisfrom.day.value="";
	thisfrom.pay_id.value="";
	thisfrom.b_money.value="";
	thisfrom.f_money.value="";
	thisfrom.item_num.value="";
	thisfrom.f.value=a;
	thisfrom.act.value=b;
	thisfrom.item_id.value=c;
	thisfrom.money.value=d;
	thisfrom.day.value=e;
	thisfrom.pay_id.value=f;
	thisfrom.b_money.value=g;
	thisfrom.f_money.value=h;
	thisfrom.item_num.value=i;
	thisfrom.submit();
}
function foot_turn3(a,b,c,d,e,f)
{
	var thisfrom=parent.foot.document.f1;
	thisfrom.action="wog_act.php";
	thisfrom.f.value="";
	thisfrom.act.value="";
	thisfrom.item_id.value="";
	thisfrom.money.value="";
	thisfrom.day.value="";
	thisfrom.item_num.value="";
	thisfrom.f.value=a;
	thisfrom.act.value=b;
	thisfrom.item_id.value=c;
	thisfrom.money.value=d;
	thisfrom.day.value=e;
	thisfrom.item_num.value=f;
	thisfrom.submit();
}
function th_submit(b,s,a)
{
	var thisfrom=b;
	thisfrom.temp_id2.value=s;
	thisfrom.temp_id.value=a;
	thisfrom.submit();
}
function th_submit2(b,a)
{
	var thisfrom=b;
	thisfrom.temp_id.value=a;
	thisfrom.submit();
}
var start_time=new Date();
start_time=Date.parse(start_time)/1000;
var pet_start_time=new Date(); 
pet_start_time=Date.parse(pet_start_time)/1000; 
var counts=0;
var x=0;
function CountDown(){
	var now=new Date();
	now=Date.parse(now)/1000;
	x=parseInt(counts-(now-start_time),10);
	if(parent.foot.document.f1){		
		parent.foot.document.f1.ats1.value = "等 "+x+" 秒";		
	}
	if(x>-1){
		timerID=setTimeout("CountDown()", 100);
		parent.foot.document.f1.ats1.disabled=true;
	}else{
		parent.foot.document.f1.ats1.disabled=false;
		parent.foot.document.f1.ats1.value = "戰　鬥";
		counts=0;
		x=0;
	}
}
function cd_add(s)
{
	counts=x+s;
	start_time=new Date();
	start_time=Date.parse(start_time)/1000;
	setup_time(start_time);
	window.setTimeout('CountDown()',100);
}
function cds(s)
{
	counts=s;
	start_time=new Date();
	start_time=Date.parse(start_time)/1000;
	setup_time(start_time);
	window.setTimeout('CountDown()',100);
}
function cd(s)
{
	start_time=new Date();
	start_time=Date.parse(start_time)/1000;
	setup_time(start_time);
	setup_cs(s);
	window.setTimeout('CountDown()',100);
}
function inCountDown(){
	var now=new Date();
	now=Date.parse(now)/1000;
	var x=parseInt(counts-(now-start_time),10);
	if(parent.top_view.document.f1){		
		parent.top_view.document.f1.ppp.value = "等 "+x+" 秒";		
	}
	if(x>-1){
		timerID=setTimeout("inCountDown()", 100);
		parent.top_view.document.f1.ppp.disabled=true;
	}else{
		parent.top_view.document.f1.ppp.disabled=false;
		parent.top_view.document.f1.ppp.value = "戰　鬥";
	}
}
function incd(s)
{
	alert("線上人數額滿,請稍後進入");
	start_time=new Date();
	start_time=Date.parse(start_time)/1000;
	setup_cs(s);
	window.setTimeout('inCountDown()',100);
}
function pet_CountDown(){
	var now_pet=new Date();
	now_pet=Date.parse(now_pet)/1000;
	var y=parseInt(pet_counts-(now_pet-pet_start_time),10);
	if(parent.foot.document.f1){		
		parent.foot.document.f1.ats2.value = y+"秒";
	}
	if(y>0){
		timerID=setTimeout("pet_CountDown()", 100);
		parent.foot.document.f1.ats2.disabled=true;
	}else{
		parent.foot.document.f1.ats2.disabled=false;
		parent.foot.document.f1.ats2.value = "牧　場";
	}
}
function pet_cd(s)
{
	pet_start_time=new Date();
	pet_start_time=Date.parse(pet_start_time)/1000;
	setup_pet_cs(s);
	window.setTimeout('pet_CountDown()',100);
}
function setup_time(time) {star_timet=time;}
function setup_cs(time) {counts=time;}
function setup_pet_cs(time) {pet_counts=time;}
//##### team  #######
function team_choose(goto)
{
	var f=parent.wog_view.document;
	f.write(temp_tebla1);
	f.write('<tr><td><input type="button" value="隊伍列表" '+(goto=="1"?'disabled':'onClick="parent.act_click(\'team\',\'list\')"')+'></td>');
	f.write('<td><input type="button" value="創立隊伍" '+(goto=="2" || t_team!=""?'disabled':'onClick="parent.team_creat();"')+'></td>');
	f.write('<td><input type="button" value="隊員狀態" '+(goto=="3" || t_team==""?'disabled':'onClick="parent.act_click(\'team\',\'status\')"')+'></td>');
	f.write('<td><input type="button" value="認領隊員" '+(goto=="4" || t_team==""?'disabled':'onClick="parent.act_click(\'team\',\'get_member\')"')+'></td>');
	f.write('<td><input type="button" value="離開隊伍" '+(t_team==""?'disabled':'onClick=if(confirm("確認您是否退出隊伍，若隊長退出隊伍視同解散隊伍")){parent.act_click(\'team\',\'leave\')}')+'></td></tr>');
	f.write(temp_tebla2);
}
function team_view()
{
	if(t_team!="")
	{
		act_click('team','status');
	}else{
		act_click('team','list');
	}
}
function team_list(saletotal,page,s)
{
	var f=parent.wog_view.document;
	message_cls();
	team_choose('1');
	f.write('<form action="wog_act.php" method="post" name=pageform target="mission">');
	pagesplit(saletotal,page);
	f.write('<input type="hidden" name="page" value="">');	
	f.write('<input type="hidden" name="f" value="team">');
	f.write('<input type="hidden" name="act" value="list">');
	f.write('</form>');
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write(temp_tebla1);
	if(s!="")
	{
		f.write('<tr bgcolor="#4B689E"><td>選擇</td><td>隊長暱稱</td><td>隊長轉生</td><td>隊長等級</td><td>隊伍名稱</td><td>人數</td></tr>');
		var s1=s.split(";");
		for(var i=0;i<s1.length;i++)
		{	
			var s2=s1[i].split(",");
			f.write('<tr onMouseOver="this.style.backgroundColor=\'#0000CD\'" onMouseOut="this.style.backgroundColor=\'\'" onclick="parent.setRadioValue(\'t_id\','+s2[0]+');" style="cursor:hand"><td ><input type="radio" name="t_id" value="'+s2[0]+'" ></td><td >'+s2[3]+'</td><td >'+s2[5]+'</td><td >'+s2[4]+'</td><td >'+s2[1]+'</td><td >'+s2[2]+'</td></tr>');
		}
		f.write('<tr><td colspan="6" align="center"><input type="submit" value="查 看 隊 伍"></td></tr>');
	}else
	{
		f.write('<tr><td colspan="5" align="center">目前無隊伍</td></tr>');
	}
	f.write('<input type="hidden" name="f" value="team">');
	f.write('<input type="hidden" name="act" value="peolist">');
	f.write('</form>');
	f.write(temp_tebla2);
}
function team_creat()
{
	var f=parent.wog_view.document;
	message_cls();
	team_choose('2');
	f.write(temp_tebla1);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<br><tr><td>隊伍名稱：<input type="text" name="t_name" size="16" maxlength="20"> <input type="button" value="創 立 隊 伍" onClick="parent.act_click(\'team\',\'creat\',this.form.t_name.value)"> </td></tr>');
	f.write('<tr><td align="center">注意：隊伍創立超過七天會自動解散，屆時請重新組隊一次</td></tr>');
	f.write('</form>');
	f.write(temp_tebla2);
}

function team_status(s,time_line,support,my_id,adm)
{
	var f=parent.wog_view.document;
	message_cls();
	team_choose('3');
	f.write(temp_tebla1);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write(temp_tebla1);
	f.write('<br><tr bgcolor="#4B689E"><td>選擇支援</td><td>名稱</td><td>等級</td><td>轉生</td><td>冒險地</td><td>狀態</td></tr>');
	var s1=s.split(";");
	if(s!="")
	{
		for(var i=0;i<s1.length;i++)
		{	
			var s2=s1[i].split(",");
			var chk="";
			var dis="";
			var dis2="";
			if(s2[0]==support)
			{
				chk="checked";
			}
			if(s2[0]==my_id)
			{
				dis="disabled";
			}
			if( (time_line-parseInt(s2[3])) < 600 )
			{
				f.write('<tr><td ><input type="radio" name="p_id" value="'+s2[0]+'" '+chk+' '+dis+'></td><td >'+s2[1]+'</td><td >'+s2[2]+'</td><td >'+s2[4]+'</td><td >'+sec[s2[5]]+'</td><td ><font color=yellow>在線</font></td></tr>');
			}else
			{
				f.write('<tr bgcolor="#474747"><td ><input type="radio" name="p_id" value="'+s2[0]+'" '+chk+' '+dis+'></td><td >'+s2[1]+'</td><td >'+s2[2]+'</td><td >'+s2[4]+'</td><td >'+sec[s2[5]]+'</td><td ><font color=red>離線</font></td></tr>');
			}
		}
		if(adm=="0")
		{
			dis2="disabled";
		}
		f.write('<tr><td colspan="6" align="center"><input type="button" value="支援隊員" onClick="parent.foot_turn(\'team\',\'support\',null,null,this.form.p_id)" > <input type="button" value="不支援" onClick="parent.act_click(\'team\',\'nosupport\')"> <input type="button" value="踢除隊員" onClick="parent.foot_turn(\'team\',\'del\',null,null,this.form.p_id)" '+dis2+'></td></tr>');
	}
	f.write('</form>');
	f.write(temp_tebla2);
}

function team_join_list(s)
{
	var f=parent.wog_view.document;
	message_cls();
	team_choose('4');
	f.write(temp_tebla1);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<br><tr bgcolor="#4B689E"><td>選擇</td><td>內容</td><td>等級</td><td>轉生</td><td>職業</td></tr>')
	if(s!="")
	{
		var s1=s.split(";");
		for(var i=0;i<s1.length;i++)
		{  
			var s2=s1[i].split(",");
			f.write('<tr><td><input type="radio" name="t_j_id" value="'+s2[0]+'" ></td><td>'+s2[1]+' 提出加入隊伍申請</td><td>'+s2[2]+'</td><td>'+s2[4]+'</td><td>'+s2[3]+'</td></tr>');
		}
		f.write('<tr><td colspan="5" align="center"><input type="button" value="邀請加入" onClick="parent.foot_turn(\'team\',\'get_save_member\',null,null,this.form.t_j_id)" ></td></tr>');
	}else
	{
		f.write('<tr><td colspan="6" align="center">沒有玩家申請加入隊伍</td></tr>');	
	}
	f.write('</form>');
	f.write(temp_tebla2);
}

function team_peolist(s,t_id,t_name,time_line)
{
	var f=parent.wog_view.document;
	message_cls();
	team_choose('1');
	f.write(temp_tebla1);
	f.write('<tr><td colspan="5" bgcolor="#3B588E">'+t_name+'</td></tr>');
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<br><tr><td>名 稱</td><td>轉 生</td><td>等 級</td><td>冒險地</td><td>狀態</td></tr>');
	if(s!="")
	{
		var s1=s.split(";");
		for(var i=0;i<s1.length;i++)
		{	
			var s2=s1[i].split(",");
			if( (time_line-parseInt(s2[4])) < 600 )
			{
				f.write('<tr><td >'+s2[0]+'</td><td >'+s2[1]+'</td><td >'+s2[2]+'</td><td >'+sec[s2[3]]+'</td><td ><font color=yellow>在線</font></td></tr>');
			}else
			{
				f.write('<tr><td >'+s2[0]+'</td><td >'+s2[1]+'</td><td >'+s2[2]+'</td><td >'+sec[s2[3]]+'</td><td ><font color=red>離線</font></td></tr>');
			}
		}
		dbsts_join="";
		if(t_team!="")
		{
			dbsts_join="disabled";
		}else
		{
			f.write('<input type="hidden" name="f" value="team"><input type="hidden" name="act" value="join"><input type="hidden" name="t_id" value="'+t_id+'">');
		}
		f.write('<tr><td colspan="5" align="center"><input type="button" value="返回列表" onClick="parent.act_click(\'team\',\'list\')">　<input type="submit" value="加入隊伍"  '+dbsts_join+' ></td></tr>');
		f.write('</form>');
	}
	f.write(temp_tebla2);
}
//##### group  #######
function group_choose(goto)
{
	var f=parent.wog_view.document;
	f.write(temp_tebla1);
	f.write('<tr><td><input type="button" value="公會列表" '+(goto=="1"?'disabled':'onClick="parent.act_click(\'group\',\'join\')"')+'></td>');
	f.write('<td><input type="button" value="創立公會" '+(goto=="2" || p_group!=""?'disabled':'onClick="parent.group_creat()"')+'></td>');
	f.write('<td><input type="button" value="會員狀態" '+(goto=="3" || p_group==""?'disabled':'onClick="parent.act_click(\'group\',\'p_list\')"')+'></td>');
	f.write('<td><input type="button" value="領地狀態" '+(goto=="4" || p_group==""?'disabled':'onClick="parent.act_click(\'group\',\'center\')"')+'></td>');
	f.write('<td><input type="button" value="認領會員" '+(goto=="5" || p_group==""?'disabled':'onClick="parent.act_click(\'group\',\'get_member\')"')+'></td>');
	f.write('<td><input type="button" value="招募資訊" '+(goto=="6" || p_group==""?'disabled':'onClick="parent.act_click(\'group\',\'ad\')"')+'></td>');
	f.write('<td><input type="button" value="公會設定" '+(goto=="7" || p_group==""?'disabled':'onclick="parent.act_click(\'group\',\'set_view\')"')+'></td></tr>');
	f.write('<tr><td><input type="button" value="佈 告 欄" '+(goto=="8" || p_group==""?'disabled':'onClick="parent.act_click(\'group\',\'book\')"')+'></td>');
	f.write('<td><input type="button" value="投 票 所" '+(goto=="9" || p_group==""?'disabled':'onclick="parent.vote()"')+'></td>');
	f.write('<td><input type="button" value="頭銜授予" '+(goto=="10" || p_group==""?'disabled':'onClick="parent.act_click(\'group\',\'set_style_view\')"')+'></td>');
	f.write('<td><input type="button" value="頭銜設定" '+(goto=="11" || p_group==""?'disabled':'onClick="parent.act_click(\'group\',\'style\')"')+'></td>');
	f.write('<td><input type="button" value="會戰狀況" '+(goto=="12" || p_group==""?'disabled':'onClick="parent.act_click(\'group\',\'news\')"')+'></td>');
	f.write('<td><input type="button" value="匯款動態" '+(goto=="13" || p_group==""?'disabled':'onclick="parent.act_click(\'group\',\'mr_view\')"')+'></td>');
	f.write('<td><input type="button" value="退出公會" '+(p_group==""?'disabled':'onClick=if(confirm("確認您是否退出公會，若會長退出公會視同解散公會")){parent.act_click(\'group\',\'del\')}')+'></td></tr>');
	f.write(temp_tebla2);
}
function group_view()
{
	if(p_group!="")
	{
		act_click('group','book');
	}else{
		act_click('group','join');
	}
}
function group_creat()
{
	var f=parent.wog_view.document;
	message_cls();
	group_choose('2');
	f.write(temp_tebla1);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<br><tr><td>公 會 名 稱 <input type="text" name="g_name" size="16" maxlength="20"> <input type="button" value="創 立 公 會" onClick="parent.act_click(\'group\',\'creat\',this.form.g_name.value)"> </td></tr>');
	f.write('<tr><td>創立公會需要資金 1000 萬元 及 轉生 四 次或以上</td></tr>');
	f.write('</form>');
	f.write(temp_tebla2);
}
function group_join(saletotal,page,s)
{
	var f=parent.wog_view.document;
	message_cls();
	group_choose('1');
	f.write('<form action="wog_act.php" method="post" name=pageform target="mission">');
	pagesplit(saletotal,page);
	f.write('<input type="hidden" name="page" value="">');	
	f.write('<input type="hidden" name="f" value="group">');	
	f.write('<input type="hidden" name="act" value="join">');
	f.write('</form>');
	f.write(temp_tebla1);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	if(s!="")
	{
		f.write('<tr bgcolor="#4B689E"><td>選擇</td><td>等級 - 名稱</td><td>兵力</td><td>平均士氣</td><td>總人數</td><td>WIN / LOST</td><td>會長</td><td>資訊</td><td>會戰</td></tr>');
		var s1=s.split(";");
		for(var i=0;i<s1.length;i++)
		{	
			var s2=s1[i].split(",");
			if(s2[9]==0) { s2[9]="關" }else{ s2[9]="開" }
			var g_ad=""; 
			if(s2[10].length>0)
			{ 
				while(s2[10].indexOf("&n") > 0)
				{ 
					s2[10]=s2[10].replace("&n","\r\n");
				} 
				g_ad="<img src='"+img+"info.gif' alt='"+s2[10]+"'>"; 
			} 
			f.write('<tr onMouseOver="this.style.backgroundColor=\'#0000CD\'" onMouseOut="this.style.backgroundColor=\'\'" onclick="parent.setRadioValue(\'g_id\','+s2[0]+');" style="cursor:hand"><td ><input type="radio" name="g_id" value="'+s2[0]+'" ></td><td >'+s2[5]+' 級 - '+s2[1]+'</td><td >'+s2[2]+'</td><td >'+s2[3]+'</td><td >'+s2[4]+'</td><td >'+s2[6]+' / '+s2[7]+'</td><td>'+s2[8]+'</td><td>'+g_ad+'</td><td>'+s2[9]+'</td></tr>');
		}
		var dbsts_join="";
		var dbsts_leave="";
		if(p_group!="")
		{
			dbsts_join="disabled";
			f.write('<input type="hidden" name="f" value="group"><input type="hidden" name="act" value="del">');
		}else
		{
			dbsts_leave="disabled";
			f.write('<input type="hidden" name="f" value="group"><input type="hidden" name="act" value="add">');
		}
		f.write('<tr><td colspan="10" align="center"><input type="submit" value="加 入 公 會"  '+dbsts_join+' > <input type="submit" value="退 出 公 會"  '+dbsts_leave+' ></td></tr>');
	}else
	{
		f.write('<tr><td colspan="10" align="center">目 前 無 公 會</td></tr>');
	}
	f.write('</form>');
	f.write(temp_tebla2);
}
function group_peolist(s,g_name,g_lv)
{
	var f=parent.wog_view.document;
	message_cls();
	group_choose('3');
	f.write(temp_tebla1);
	f.write('<tr><td colspan="8" bgcolor="#3B588E">'+g_lv+' 級公會：'+g_name+'</td></tr>');
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<br><tr><td>選 擇</td><td>名 稱</td><td>士 氣</td><td>兵 力</td><td>轉 生</td><td>等 級</td><td>駐 守 領 土</td><td>貢 獻 度</td></tr>');
	if(s!="")
	{
		var s1=s.split(";");
		for(var i=0;i<s1.length;i++)
		{	
			var s2=s1[i].split(",");
			if(s2[3]=="")
			{s2[3]="0";}
			f.write('<tr onMouseOver="this.style.backgroundColor=\'#0000CD\'" onMouseOut="this.style.backgroundColor=\'\'" onclick="parent.setRadioValue(\'p_id\',\''+s2[0]+'\')" style="cursor:hand"><td><input type="radio" name="p_id" value="'+s2[0]+'" ></td><td >'+s2[9]+s2[1]+'</td><td >'+s2[2]+'</td><td >'+s2[3]+'</td><td >'+s2[6]+'</td><td >'+s2[4]+'</td><td >'+s_status(s2[5])+'領</td><td >'+s2[8]+'</td></tr>');
		}
		if(s2[7]==1) {
			var exp_yes="checked";
			var exp_no="";
		}else {
			var exp_yes="";
			var exp_no="checked";	
		}
		f.write('<tr><td colspan="8" bgcolor="#3B588E">會 員 資 格 與 駐 守 點 設 定</td></tr>');
		f.write('<tr><td colspan="8"><input type="radio" name="mod_type" value="1">駐守點<select name="g_a_type" onChange="this.form.mod_type[0].checked=true"><option value="" SELECTED>請選擇</option><option value="1">地領</option><option value="2">水領</option><option value="3">火領</option><option value="4">木領</option><option value="5">風領</option><option value="6">毒領</option><option value="7">無領</option></select>　<input type="radio" name="mod_type" value="2">設定職務<select name="permissions" onChange="this.form.mod_type[1].checked=true"><option value="" SELECTED>請選擇</option><option value="1">副會長</option><option value="2">進階會員</option><option value="3">初階會員</option></select>　<input type="radio" name="mod_type" value="3">取消會員資格');
		f.write('　<input type="submit" value="確 定 變 更"></td></tr>');
		f.write('<input type="hidden" name="f" value="group">');
		f.write('<input type="hidden" name="act" value="number">');
		f.write('</form>');
		f.write('<form action="wog_act.php" method="post" target="mission">');
		f.write('<tr><td colspan="8" bgcolor="#3B588E">會 員 個 人 設 定</td></tr>');
		f.write('<tr><td colspan="8" >經驗貢獻（5%*公會等級+1）：<input type="radio" name="g_g_exp" value="1" '+exp_yes+'>開 <input type="radio" name="g_g_exp" value="0" '+exp_no+'>關　<input type="submit" value="設 定"> | <input type="button" value="使用技能" onClick="parent.act_click(\'group\',\'skill_use\')"> | <input type="button" value="進入倉庫" onClick="parent.act_click(\'group\',\'depot_view\',\'a_id\')"></td></tr>');
		f.write('<input type="hidden" name="f" value="group">');
		f.write('<input type="hidden" name="act" value="player_set">');
		f.write('<tr><td colspan="8">只有會長與副會長才能改變會員駐守地點以及取消會員資格<br>若會長取消自身的會員資格視同解散公會<br>經驗貢獻功能用於會員貢獻經驗轉化成公會經驗，公會經驗用途甚廣</td></tr>');
	}
	f.write(temp_tebla2);
}
function group_center(s,temp_s,fire,money)
{
	var f=parent.wog_view.document;
	message_cls();
	group_choose('4');
	if(fire==1)
	{
		var yes="checked";
		var no="";
	}else
	{
		var yes="";
		var no="checked";	
	}
	f.write(temp_tebla1);
	f.write('<br><tr bgcolor="#4B689E"><td colspan="5">領 土 情 況</td></tr>');
	f.write('<tr><td>領 土</td><td>總 兵 力</td><td>平 均 士 氣</td><td>防 禦 度</td><td>人 數</td></tr>');
	if(s!="")
	{
		var s1=s.split(";");
		for(var i=0;i<s1.length;i++)
		{	
			var s2=s1[i].split(",");
			if(s2[1]=="")
			{s2[1]="0";}
			f.write('<tr><td >'+s_status(s2[0])+'領</td><td >'+s2[1]+'</td><td >'+s2[2]+'</td><td >'+s2[3]+'</td><td >'+s2[4]+'</td></tr>');
		}
	}
	f.write(temp_tebla2);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write(temp_tebla1);
	if(temp_s!="")
	{
		var s1=temp_s.split(",");
		f.write('<tr><td colspan="4" bgcolor="#3B588E">駐 守 領 土－'+s_status(s1[0])+'</td></tr>');
		f.write('<tr><td>領 土</td><td>兵 力</td><td>士 氣</td></tr>');
		f.write('<tr><td >'+s_status(s1[0])+'領</td><td >'+s1[1]+'</td><td >'+s1[2]+'</td></tr>');
		f.write('<tr><td colspan="4"><input type="button" value="提 升 士 氣" onClick="parent.act_click(\'group\',\'up_morale\')">　<input type="button" value="修 補 城 牆" onClick="parent.act_click(\'group\',\'up_hp\')">　<input type="button" value="補 充 兵 力" onClick="parent.act_click(\'group\',\'up_number\',document.forms[0].number.value)"><select name="number" size="1">');
		for(var i=1;i<=9;i++)
		{
			f.write('<option value='+(1000*i)+'>'+(1000*i)+'</option>');
		}
		f.write('<option value=15000>補 滿</option></select></td></tr>');
		f.write('<tr><td colspan="4">提升士氣：1000元（上限：1百）｜修補城牆：100萬（上限：5百）｜每補充1兵力：10元（上限：1萬）</td></tr>');
	}
	f.write('<tr><td colspan="4" bgcolor="#3B588E">公會資金：'+money+'</td></tr>');
	f.write('<tr><td colspan="4">金額：<input type="text" name="g_money" size="10">&nbsp<input type="button" value="貢 獻" onClick="parent.act_click(\'group\',\'up_money\',document.forms[0].g_money.value,1)">&nbsp-&nbsp<input type="button" value="提 領" onClick="parent.act_click(\'group\',\'up_money\',document.forms[0].g_money.value,2)">捐獻或提領公款</td></tr>');
	f.write(temp_tebla2);
	f.write('</form>');
}
function group_join_list(s)
{
	var f=parent.wog_view.document;
	message_cls();
	group_choose('5');
	f.write(temp_tebla1);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<br><tr bgcolor="#3B588E"><td>選 擇</td><td>內 容</td><td>轉 生</td><td>等 級</td><td>職 業</td></tr>')
	if(s!="")
	{
		var s1=s.split(";");
		for(var i=0;i<s1.length;i++)
		{  
			var s2=s1[i].split(",");
			f.write('<tr onMouseOver="this.style.backgroundColor=\'#0000CD\'" onMouseOut="this.style.backgroundColor=\'\'" onclick="parent.setRadioValue(\'g_j_id\','+s2[0]+')" style="cursor:hand"><td><input type="radio" name="g_j_id" value="'+s2[0]+'" ></td><td>'+s2[1]+' 提出加入公會申請</td><td>'+s2[4]+'</td><td>'+s2[2]+'</td><td>'+s2[3]+'</td></tr>');
		}
		f.write('<tr><td colspan="5" align="center"><input type="button" value="同 意 加 入" onClick="parent.foot_turn(\'group\',\'get_save_member\',null,null,this.form.g_j_id)" >　<input type="button" value="拒 絕 申 請" onClick="parent.foot_turn(\'group\',\'del_member\',null,null,this.form.g_j_id)" ></td></tr>');
	}else
	{
		f.write('<tr><td colspan="5" align="center">沒 有 玩 家 申 請 加 入</td></tr>');	
	}
	f.write('</form>');
	f.write(temp_tebla2);
}
function group_book_view(temp)
{
	var f=parent.wog_view.document;
	message_cls();
	group_choose('8');
	f.write(temp_tebla1);
	f.write('<br><tr><td bgcolor="#3B588E">公 會 佈 告 欄</td></tr>');
	if(temp.length<=0)
	{
		f.write('<tr><td>沒 有 資 料</td></tr>');	
	}else
	{
		while(temp.indexOf("&n") > 0)
		{
			temp=temp.replace("&n","<br>");
		}
		f.write('<tr><td>'+temp+'</td></tr>');	
	}	
	f.write(temp_tebla2);
	f.write(temp_tebla1);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<br><tr><td><textarea cols="30" rows="5" name="g_book"></textarea></td></tr>');
	f.write('<tr><td><input type="button" value="確 定 送 出" onClick="parent.act_click(\'group\',\'save_book\',this.form.g_book.value)">&nbsp<input type="button" value="清 除" onClick="parent.act_click(\'group\',\'book_removal\')"></td></tr>');
	f.write('<tr><td><會 長 及 副 會 長 專 用></td></tr>');
	f.write('</form>');
	f.write(temp_tebla2);
}

function group_ad_view(temp)
{
	var f=parent.wog_view.document;
	message_cls();
	group_choose('6');
	f.write(temp_tebla1);
	f.write('<br><tr><td bgcolor="#3B588E">公 會 招 募 訊 息</td></tr>');
	if(temp.length<=0)
	{
		f.write('<tr><td>沒 有 資 料</td></tr>');   
	}else
	{
		while(temp.indexOf("&n") > 0)
		{
			temp=temp.replace("&n","<br>");
		}
		f.write('<tr><td>'+temp+'</td></tr>');   
	}   
	f.write(temp_tebla2);
	f.write(hr);
	f.write(temp_tebla1);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<br><tr><td><textarea cols="30" rows="5" name="g_ad"></textarea></td></tr>');
	f.write('<tr><td><input type="button" value="確 定 送 出" onClick="parent.act_click(\'group\',\'save_ad\',this.form.g_ad.value)">&nbsp<input type="button" value="清 除" onClick="parent.act_click(\'group\',\'ad_removal\')"></td></tr>');
	f.write('<tr><td><會 長 或 副 會 長 專 用></td></tr>');
	f.write('</form>');
	f.write(temp_tebla2);
}

function group_style_view(temp,page)
{
   var f=parent.wog_view.document;
   message_cls();
   group_choose('11');
   f.write(temp_tebla1);
   f.write('<form action="wog_act.php" method="post" target="mission">');
   if(!page)
   {
      f.write('<br><tr bgcolor="#4B689E"><td colspan="3">注意：請順位階次序增減 , 否則會造成部份頭銜設定出現狀況</td></tr>');
      f.write('<tr bgcolor="#3B588E"><td width=10%>位 階 排 行</td><td width=60%>名 稱</td><td width=30%>更 改</td></tr>');
      var s1=temp.split(";");
      for(var a=0;a<15;a++)
      {
         if(s1[a])
         {
            s2=s1[a].split(",");
            f.write('<tr><td>'+s2[1]+'</td><td>'+s2[0]+'</td><td><input type="button" value="修 改" onClick="parent.act_click(\'group\',\'chang_style\','+s2[1]+')"><input type="button" value="刪 除" onClick="parent.act_click(\'group\',\'removal_style\','+s2[1]+')"></td></tr>');
         }else
         {
            var b=a+1;
            f.write('<tr><td>'+b+'</td><td>未 設 定</td><td><input type="button" value="修 改" onClick="parent.act_click(\'group\',\'chang_style\','+b+')"></td></tr>');
         }
      }
   }else
   {
   	  f.write('<br><tr bgcolor="#4B689E"><td colspan="3">注意：請順位階次序增減 , 否則會造成部份頭銜設定出現狀況</td></tr>');
      f.write('<tr bgcolor="#3B588E"><td width=10%>位 階 排 行</td><td width=60%>名 稱</td><td width=30%>更 改</td></tr>');
      s=temp.split(",");
      f.write('<tr><td>'+s[1]+'</td><td><input type="text" name="chang" value="'+s[0]+'"></td><td><input type=button value="修 改" onClick="parent.act_click(\'group\',\'save_style\',this.form.chang.value,'+s[1]+')"></td></tr>');
      f.write('<input type="hidden" name="level" value="'+s[1]+'">');
   }
   f.write('</form>');
   f.write(temp_tebla2);
}
function group_style_set_view(temp,page,player)
{
   var f=parent.wog_view.document;
   message_cls();
   group_choose('10');
   f.write(temp_tebla1);
   f.write('<form action="wog_act.php" method="post" target="mission">');
   if(!page)
   {
      f.write('<br><tr bgcolor="#3B588E"><td width=60%>會 員 名 稱</td><td width=10%>頭 銜 有 無</td><td width=30%>頭 銜</td></tr>');
      var s1=temp.split(";");
      for(var a=0;a<s1.length;a++)
      {
         var s2=s1[a].split(",");
         if(s2[2]==0){var p_style="無";}else{var p_style="有";}
         f.write('<tr><td>'+s2[1]+'</td><td>'+p_style+'</td><td><input type="button" value="授 與" onClick="parent.act_click(\'group\',\'set_style_chang\','+s2[0]+')">　<input type="button" value="取 消" onClick="parent.act_click(\'group\',\'set_style_removal\','+s2[0]+')"></td></tr>');
      }

   }else
   {
   	  var s1=temp.split(";");
      f.write('<br><tr bgcolor="#4B689E"><td width=10%>玩家編號</td><td width=60%>選擇頭銜</td><td width=30%>更改</td></tr>');
      f.write('<tr><td>'+player+'</td><td><select name="set_style">');
      for(var a=0;a<s1.length;a++)
      {
      	 var s2=s1[a].split(",");
         if(s2[2]){var p_check="style='background-color:#ffff00'";}else{var p_check="";}
         f.write('<option value='+s2[1]+' '+p_check+'>'+s2[0]+'</option>');
      }
      f.write('</select></td><td><input type=submit value="修 改"></td></tr>');
      f.write('<input type="hidden" name="f" value="group">');
      f.write('<input type="hidden" name="act" value="set_style_save">');
      f.write('<input type="hidden" name="p_name" value="'+player+'">');
   }
   f.write('</form>');
   f.write(temp_tebla2);
}
function group_set_view(g_id,fire,join_type,peo,exp,upexp,peo_max,lv)
{
	var f=parent.wog_view.document;
	message_cls();
	group_choose('7');
	f.write('<form action="wog_act.php" method="POST" target="mission" name="f1">'); 
	f.write(temp_tebla1); 
	f.write('<tr><td colspan="3" bgcolor="#3B588E">公 會 設 定</td></tr>'); 
	f.write('<tr><td width="20%" bgcolor="#4B689E">公會升級</td><td width="65%">當前公會等級：'+lv+'級，升級所需經驗：'+upexp+'，目前經驗：'+exp+'</td><td width="15%"><input type="button" value="升級" onclick="parent.foot_turn(\'group\',\'set\',\'uplv\')"></td></tr>'); 
	f.write('<tr><td colspan="3">'+hr+'</td></tr>'); 
	f.write('<tr><td width="20%" bgcolor="#4B689E">公會技能</td><td width="65%">需耗用公會經驗才能學習與升級技能</td><td width="15%"><input type="button" value="進入" onclick="parent.act_click(\'group\',\'skill_view\',1)"></td></tr>'); 
	f.write('<tr><td colspan="3">'+hr+'</td></tr>'); 
	f.write('<tr><td width="20%" bgcolor="#4B689E">公會階級</td><td width="65%">設定使用公會技能，倉庫取物等會員階級條件</td><td width="15%"><input type="button" value="進入" onclick="parent.act_click(\'group\',\'class_view\')"></td></tr>'); 
	f.write('<tr><td colspan="3">'+hr+'</td></tr>'); 
	f.write('<tr><td width="20%" bgcolor="#4B689E">會戰設定</td><td width="65%"><input type="radio" name="fire_set" value="0">關 <input type="radio" name="fire_set" value="1">開</td><td width="15%"><input type="button" value="設定" onclick="parent.foot_turn(\'group\',\'set\',\'fire\',\'\',document.f1.fire_set)"></td></tr>'); 
	f.write('<tr><td colspan="3">'+hr+'</td></tr>'); 
	f.write('<tr><td width="20%" bgcolor="#4B689E">招生方式</td><td width="65%"><input type="radio" name="jointype_set" value="0">會長驗證 <input type="radio" name="jointype_set" value="1">自動加入</td><td width="15%"><input type="button" value="設定" onclick="parent.foot_turn(\'group\',\'set\',\'join_type\',\'\',document.f1.jointype_set)"></td></tr>'); 
	f.write('<tr><td colspan="3">'+hr+'</td></tr>'); 
	f.write('<tr><td width="20%" bgcolor="#4B689E">公會人數上限</td><td width="65%"><input type="text" name="peo_max" value="'+peo+'" size="6">人 (不限人數請設置為0人, 當前等級最高'+peo_max+'人)</td><td width="15%"><input type="button" value="設定" onclick="parent.foot_turn(\'group\',\'set\',\'peo_max\',document.f1.peo_max.value)"></td></tr>'); 
	f.write(temp_tebla2); 
	f.write('</form>'); 
	f.f1.fire_set[fire].checked=true; 
	f.f1.jointype_set[join_type].checked=true; 
}
function vote() 
{ 
   var f=parent.wog_view.document; 
   message_cls(); 
   group_choose('9');
   f.write(temp_tebla1); 
   f.write('<br><tr><td bgcolor=#4B689E colspan=2>公 會 投 票 所</td></tr>'); 
   f.write('<tr><td><input type="button" value="顯 示 投 票" onclick="parent.act_click(\'vote\',\'list\')"></td><td><input type="button" value="建 立 投 票" onclick="parent.vote_create()"></td></tr>'); 
   f.write(temp_tebla2); 
} 

function vote_list(temp) 
{ 
   var f=parent.wog_view.document; 
   message_cls(); 
   group_choose();
   f.write('<form action="wog_act.php" method="POST" target="mission">'); 
   f.write(temp_tebla1); 
   f.write('<tr bgcolor=#4B689E><td width=4%>選擇</td><td width=24%>投票主題</td><td width=10%>發起人</td><td width=10%>發起公會</td><td width=12%>投票量</td><td width=20%>開始時間</td><td width=20%>結束時間</td></tr>'); 
   if(temp) 
   { 
      var s1=temp.split(";"); 
      for(var li=0;li<s1.length;li++) 
      { 
         var s=s1[li].split(","); 
         f.write('<tr><td><input type="radio" name="v_id" value="'+s[0]+'"></td><td>'+s[1]+'</td><td>'+s[2]+'</td><td>'+s[3]+'</td><td>'+s[6]+'</td><td>'+s[4]+'</td><td>'+s[5]+'</td></tr>'); 
      } 
      f.write('<tr><td colspan=7><input type="submit" value="閱 讀 內 容"> <input type="button" value="投 票 結 果" onclick="parent.foot_turn(\'vote\',\'end_view\',\'\',\'\',document.forms[0].v_id);"> <input type="button" value="刪 除 投 票" onclick="parent.foot_turn(\'vote\',\'delete\',\'\',\'\',document.forms[0].v_id);"></td></tr>'); 
       
   }else 
   { 
      f.write('<tr><td colspan=7>目 前 沒 有 任 何 投 票</td></tr>'); 
   } 
   f.write(temp_tebla2); 
   f.write('<input type="hidden" name="f" value="vote">'); 
   f.write('<input type="hidden" name="act" value="view">'); 
   f.write('</form>'); 
} 

function vote_view(temp,id,title,name,cause,num,begindate,enddate) 
{
   var f=parent.wog_view.document; 
   message_cls(); 
   group_choose();
   f.write('<form action="wog_act.php" method="POST" target="mission">'); 
   f.write(temp_tebla1); 
   f.write('<tr><td colspan="2" bgcolor="#3B588E">'+title+'</td></tr>'); 
   f.write('<tr><td width="25%" bgcolor="#4B689E">發起人</td><td width="75%" bgcolor="#4B689E">投票原因</td>');
   f.write('<tr><td height="32">'+name+'</td><td valign="top" rowspan="5">'+cause+'</td>');
   f.write('<tr><td bgcolor="#4B689E">開始時間</td></tr>'); 
   f.write('<tr><td height="32">'+begindate+'</td></tr>');
   f.write('<tr><td  bgcolor="#4B689E">結束時間</td></tr>');
   f.write('<tr><td height="32">'+enddate+'</td></tr>');
   f.write('<tr><td colspan="2" bgcolor="#4B689E">投票項目</td></tr>'); 
   f.write('<tr><td colspan="2">每人最多可投 <font color="yellow">'+num+'</font> 票<br><br>'); 
   f.write('<table border="0" width="50%" align=center>'); 
   var s1=temp.split(";");
   for(var li=0;li<s1.length;li++)
   { 
      var s=s1[li].split(","); 
      var button_type=(parseInt(num)>1)?'<input type="checkbox" name="list[]" value='+s[0]+'>':'<input type="radio" name="list" value='+s[0]+'>'; 
      f.write('<tr><td width="5%">'+button_type+'</td><td style="text-align:left">'+s[1]+'</td></tr>'); 
   } 
   f.write('</table><br><br></td></tr>'); 
   f.write('<tr><td colspan="3"><input type="submit" value="完 成 投 票"> <input type="button" value="投 票 結 果" onclick="parent.act_click(\'vote\',\'end_view\','+id+')"></td></tr>'); 
   f.write(temp_tebla2); 
   f.write('<input type="hidden" name="f" value="vote">'); 
   f.write('<input type="hidden" name="act" value="add">'); 
   f.write('<input type="hidden" name="v_id" value="'+id+'">'); 
   f.write('</form>'); 
}

function vote_end_view(temp,title,tatal) 
{
   var f=parent.wog_view.document; 
   message_cls(); 
   group_choose();
   f.write(temp_tebla1); 
   f.write('<br><tr><td colspan=4 bgcolor="#4B689E">投 票 結 果</td></tr>'); 
   f.write('<tr><td colspan=2 bgcolor="#3B588E">'+title+'</td><td colspan=2 bgcolor="#3B588E">總票數： '+tatal+' 票</td></tr>'); 
   var s1=temp.split(";"); 
   for(var li=0;li<s1.length;li++) 
   {
      var s=s1[li].split(","); 
      var per=(parseInt(s[1]) > 0)?Math.round((parseInt(s[1])/parseInt(tatal))*1000)/10:0; 
      f.write('<tr><td width=45%>'+s[0]+'</td><td width=15% style="text-align:left"><img src='+img+'bar/bxg.gif border=0 width='+per+'% height=12></td><td width=20%>'+s[1]+' 人</td><td width=20%>'+per+'%</td></tr>'); 
   }
   f.write('<tr><td colspan=4 bgcolor="#4B689E"><input type="button" value="顯 示 投 票" onclick="parent.act_click(\'vote\',\'list\')"></td></tr>'); 
   f.write(temp_tebla2);
}

function vote_create() 
{ 
   var f=parent.wog_view.document; 
   message_cls(); 
   group_choose();
   f.write('<form action="wog_act.php" method="POST" target="mission" name="f1">'); 
   f.write(temp_tebla1); 
   f.write('<tr><td bgcolor="#4B689E" colspan="4">建 立 新 投 票</td></tr>'); 
   f.write('<tr><td valign="top" width="15%">投票主題</td><td valign="top" width="35%"><input type="text" name="title" size=30 maxlength=30></td><td width="15%" valign="top" rowspan="2">投票項目</td><td width="35%" rowspan="2"><div id="list_span">');
   for(var a=1;a<=5;a++) 
   {
      f.write('<input type="text" name="list['+a+']" size=30 maxlength=30><br>'); 
   }
   f.write('</div><input type="button" name="list_add" value="追加項目" onclick="parent.vote_list_add(document.f1)"></td></tr>');
   f.write('<tr><td valign="top">投票原因</td><td valign="top"><textarea name="cause" cols=24 rows=6></textarea></td>');  
   f.write('<tr><td valign="top" rowspan="2">可投票數</td><td rowspan="2">'); 
   for(var a=1;a<=5;a++) 
   { 
      var check=(a==1)?"checked":""; 
      f.write('<input type="radio" name="num" value="'+a+'" '+check+'>'+a+' 票<br> '); 
   } 
   f.write('</td><td valign="top">投票權限</td><td><input type="radio" name="lv" value="1" checked>公會內部 <br><input type="radio" name="lv" value="2">全體公會</td></tr>'); 
   f.write('<tr><td valign="top">投票時間</td><td><select name=date>'); 
   for(var a=1;a<=30;a++) 
   { 
      f.write('<option value="'+a+'">'+a+' 天 '); 
   } 
   f.write('</select></td></tr>');
   f.write('<tr><td colspan="4"><input type="button" value="建 立 投 票" onclick="parent.form_send(document.f1)"> <input type="reset" value="重 寫 內 容"></td></tr>'); 
   f.write(temp_tebla2); 
   f.write('<input type="hidden" name="f" value="vote">'); 
   f.write('<input type="hidden" name="act" value="create">'); 
   f.write('</form>'); 
}
function vote_list_add(frm)
{
   var f=parent.wog_view.document;
   var getInput=frm.getElementsByTagName('input');
   var list=new Array();
   for(var i=0;i < getInput.length;i++)
   {
      if((getInput[i].name).substr(0,4) == "list")
      {
         list.push(getInput[i]);
      }
   }
   if(list.length > 10)
   {
      f.f1.list_add.disabled=true;
      return false;
   }
   f.getElementById('list_span').innerHTML+='<input type="text" name="list['+list.length+']" size=30 maxlength=30><br>';
}
function group_fire_list_peo(s,gs)
{
	var f=parent.wog_view.document;
	message_cls();
	f.write(temp_tebla1);
	f.write('<form action="wog_fight.php" method="post" target="mission">');
	f.write('<br><tr><td>名 稱</td><td>士 氣</td><td>兵 力</td><td>駐 守 地</td></tr>');
	if(s!="")
	{
		var s1=s.split(";");
		for(var i=0;i<s1.length;i++)
		{
			var s2=s1[i].split(",");
			f.write('<tr><td>'+s2[0]+'</td><td>'+s2[1]+'</td><td>'+s2[2]+'</td><td>'+s_status(s2[3])+'</td></tr>');
		}

	}
	f.write('<tr><td colspan="5" align="center"><select name="to_group" size="1">');
	f.write('<option value="">請選擇敵方公會</option>');
	if(gs!="")
	{
		var s1=gs.split(";");
		for(var i=0;i<s1.length;i++)
		{		
			var s2=s1[i].split(",");
			f.write('<option value='+s2[0]+'>'+s2[1]+'</option>');
		}

	}
	f.write('</select> <input type="radio" name="g_a_type" value="1">地 <input type="radio" name="g_a_type" value="2">水 <input type="radio" name="g_a_type" value="3">火 <input type="radio" name="g_a_type" value="4">木 <input type="radio" name="g_a_type" value="5">風 <input type="radio" name="g_a_type" value="6">毒</td></tr>');
	f.write('<tr><td colspan="5" align="center"><input type="submit" value="戰 鼓 宣 揚！出擊！！"></td></tr>');
	f.write('<input type="hidden" name="f" value="fire"><input type="hidden" name="temp_id" value="2">');
	f.write('</form>');
	f.write(temp_tebla2);
}
function group_p_act(temp_d,morale,number)
{
	temp_d=' <font color=red><b>'+temp_d+'<b></font>'
	group_view_fight(temp_d,morale,number,p_name,m_name);
}
function group_m_act(temp_d,morale,number)
{
	temp_d=' <font color=red><b>'+temp_d+'<b></font>'
	group_view_fight(temp_d,morale,number,m_name,p_name);
}
function group_exm_act(temp_d,morale,number)
{
	temp_d=' <font color=red><b>'+temp_d+'<b></font>'
	group_view_fight(temp_d,morale,number,'城堡',p_name);
}
function group_exm2_act(temp_d)
{
	temp_d=' <font color=red><b>'+temp_d+'<b></font>'
	var f=parent.wog_view.document;
	f.write(hr);
	f.write(temp_tebla1+'<br><tr><td colspan="2" ><font color="#81D8A8">城堡</font>受到 '+temp_d+' 傷害 </td></tr>');
	f.write(temp_tebla2);
}
function group_view_fight(temp_d,morale,number,f,d)
{
	var ff=parent.wog_view.document;
	(f==p_name)?f='<font color="#89C7F3">'+f+'</font>':f='<font color="#81D8A8">'+f+'</font>';
	(d==p_name)?d='<font color="#89C7F3">'+d+'</font>':d='<font color="#81D8A8">'+d+'</font>';
	ff.write(hr);
	ff.write(temp_tebla1+'<br><tr><td colspan="2" >'+f+' 給予 '+d+temp_d+' 傷害 | '+d+' 士氣'+morale+' 兵力'+number+'</td></tr>');
	ff.write(temp_tebla2);
}
function group_fire_title(a,de_hp,me_s,de_s)
{
	var f=parent.wog_view.document;
	message_cls();
	var p_name=get_name();
	f.write(temp_tebla1);
	f.write('<br><tr><td colspan="3">'+s_status(a)+'領 － 防禦度 : '+de_hp+'</td></tr>');
	f.write('<tr><td colspan="3">'+hr+'</td></tr>');
	f.write('<tr><td colspan="3">攻 擊 方</td></tr>');
	var s2=me_s.split(",");
	f.write('<tr><td>名 稱</td><td>兵 力</td><td>士 氣</td></tr>');
	f.write('<tr><td>'+s2[0]+'</td><td>'+s2[1]+'</td><td>'+s2[2]+'</td></tr>');
	f.write('<tr><td colspan="3">'+hr+'</td></tr>');
	if(de_s!="")
	{
		f.write('<tr><td colspan="3">守 備 方</td></tr>');
		var s2=de_s.split(",");
		setup_mname(s2[0]);
		f.write('<tr><td>名 稱</td><td>兵 力</td><td>士 氣</td></tr>');
		f.write('<tr><td>'+s2[0]+'</td><td>'+s2[1]+'</td><td>'+s2[2]+'</td></tr>');
	}
	f.write(temp_tebla2);
}
//##### pet #######
function pet_break()
{
	var f=parent.wog_view.document;
	f.write(fight_temp_tebla1);
	f.write('<br><tr><td>'+d_item_name+' 受到損壞，數量減少 1 個！！</td></tr>');
	f.write(temp_tebla2);
}
function pet_end()
{
	var f=parent.wog_view.document;
	f.write(fight_temp_tebla1);
	f.write('<br><tr><td>捕捉器已經用光光了，再去裝備吧！</td></tr>');
	f.write(temp_tebla2);
}
function pet_get(s)
{
	var f=parent.wog_view.document;
	f.write(fight_temp_tebla1);
	f.write('<br><tr><td>恭喜捕捉到 '+s+'，'+d_item_name+' 數量減少 1 個！！</td></tr>');
	parent.wog_log_save('恭喜捕捉到 '+s);
	f.write(temp_tebla2);
}
function pet_index(name,mname,id,s,pe_list)
{
	var f=parent.wog_view.document;
	message_cls();
	f.write('<form action="wog_act.php" method="post" target="mission" name=f1>');	
	f.write(temp_tebla1);
	f.write('<tr bgcolor="#4B689E"><td>名稱</td><td>AT</td><td>MT</td><td>DEF</td><td>飽腹</td></tr>');
	var s1=s.split(",");
	var m_img=s1[10];
	if(m_img=="")
	{
		m_img="no_img.jpg";
	}
	if(s1[11]==0)
	{
		m_img=mimg+m_img;
	}
	load_img(m_img,150,150);
	f.write('<tr><td rowspan="6">'+name+'-'+mname+' '+s1[6]+'歲<br><img src="'+m_img+'" height="'+height+'" width="'+width+'" ><br><a href="javascript:parent.pet_leave('+id+');">放生</a></td><td>'+s1[0]+'</td><td>'+s1[1]+'</td><td>'+s1[2]+'</td><td>'+s1[3]+'</td></tr>');
	f.write('<tr bgcolor="#4B689E"><td>個性</td><td>出擊值</td><td>親密度</td><td>疲勞</td></tr>');
	f.write('<tr><td>'+pet_type(s1[5])+'</td><td>'+s1[8]+'</td><td>'+s1[7]+'</td><td>'+s1[4]+'</td></tr>');
	f.write('<tr><td colspan="4">狀態：<input type="radio" name="pe_st" value="0" onclick="parent.foot_turn(\'pet\',\'chg_st\','+id+',0);">攜帶 <input type="radio" name="pe_st" value="2" onclick="parent.foot_turn(\'pet\',\'chg_st\','+id+',2);">獸欄</td></tr>');
	f.write('<tr><td colspan="4">選擇寵物：');
	var s2=pe_list.split(";");
	for(var i=0;i<s2.length;i++)
	{
		var s3=s2[i].split(",");
		f.write(' <a href=javascript:parent.act_click(\'pet\',\'index\',\''+s3[1]+'\')>'+s3[0]+'</a>');
	}
	f.write('</td></tr>');
	f.write('<tr><td colspan="4"><input type="text" value="'+name+'" size="15" maxlength="30" name=rename> <input type="button" value="改名" onclick="parent.foot_turn(\'pet\',\'rename\','+id+',document.f1.rename.value);"></td></tr>');
	f.write('<tr><td colspan="5"><select name="act" ><option value="1" SELECTED>AT修行</option><option value="2" >MT修行</option><option value="3" >DEF修行</option><option value="4" >FI修行</option></select> <input type="button" value="特訓" onclick="parent.foot_turn(\'pet\',\'ac\','+id+',document.f1.act.value);"> <select name="act1" ><option value="1" SELECTED>活力果實</option><option value="2" >香氣果實</option><option value="3" >甜味果實</option><option value="4" >野性果實</option></select> <input type="button" value="餵食" onclick="parent.foot_turn(\'pet\',\'eat\','+id+',document.f1.act1.value);"></td></tr>');
	f.write('<tr><td colspan="5">拍賣金額 <input type="text" size="15" name=money> <input type="button" value="拍賣" onclick="parent.foot_turn(\'pet\',\'sale\','+id+',document.f1.money.value);"></td></tr>');
	f.write('<tr><td colspan="5">輸入圖像連結 <input type="text" name="url" value="http://" size="30" maxlength="200"> <input type="button" value="自訂圖像" onclick="parent.foot_turn(\'pet\',\'img\',document.f1.url.value,'+id+');"> <input type="button" value="還原圖像" onclick="parent.act_click(\'pet\',\'unimg\','+id+');"></td></tr>');
	f.write('<tr><td colspan="5" class=b1><ol><li>餵食寵物須花費 500 元</li><li>寵物過勞或親密過低,特訓時會有機率死亡或逃跑（安全值：疲勞 80↓ | 親密 50↑）</li><li>選擇攜帶時,寵物會根據親密值及主人魅力值,隨機出現支援戰鬥或抵擋敵人攻擊</li><li>有攜帶寵物時,戰鬥中不能抓寵物</li><li>牧場能照顧寵物上限為 5 </li><li>拍賣日數統一為 5 天</li></ol></td></tr>');
	f.write('<input type="hidden" name="pet_id" value="'+id+'">');
	f.write(temp_tebla2);
	f.write('</form>');
	if(s1[9]=="0")
	{
		f.f1.pe_st[0].checked=true;
	}else
	{
		f.f1.pe_st[1].checked=true;
	}
};
function pet_fight()
{
	var f=parent.wog_view.document;
	message_cls();
	f.write(temp_tebla1);
	f.write('<form action="wog_act.php" method="post" target="mission" name=f1>');
	f.write('<tr><td><input type="radio" name="temp_id2" value="1"></td><td>幼年級組</td><td>限3歲以下寵物參加</td></tr>');
	f.write('<tr><td><input type="radio" name="temp_id2" value="2"></td><td>中年級組</td><td>限4-7歲寵物參加</td></tr>');
	f.write('<tr><td><input type="radio" name="temp_id2" value="3"></td><td>高年級組</td><td>限8-12歲寵物參加</td></tr>');
	f.write('<tr><td><input type="radio" name="temp_id2" value="4"></td><td>老年級組</td><td>限13-18歲寵物參加</td></tr>');
	f.write('<tr><td colspan="3"><input type="radio" name="a_mode" value="1" checked>快速模式  <input type="radio" name="a_mode" value="2" >一般模式</td></tr>');
	f.write('<tr><td colspan="3">押注金額 : <input type="text" name="pay_id" ></td></tr>');
	f.write('<tr><td colspan="3">賠率 1 : 2 | 最小賭注 5000 最大賭注 500000</td></tr>');
	f.write('<tr><td colspan="5"><input type="submit" value="開始比賽"></td></tr>');
	f.write('<input type="hidden" name="f" value="pet">');
	f.write('<input type="hidden" name="act" value="fight">');
	f.write('</form>');
	f.write(temp_tebla2);
}
function pet_fview(p,m)
{
	var f=parent.wog_view.document;
	var p1=p.split(",");
	var m1=m.split(",");
	pet_pname=p1[0]+"-"+p1[1];
	pet_mname=m1[0]+"-"+m1[1];
	message_cls();
	f.write(temp_tebla1+'<tr ><td colspan="2" >'+pet_pname+'</td><td colspan="2" >'+pet_mname+'</td></tr>');
	f.write('<tr bgcolor="'+tr_bgcolor+'"><td>HP</td><td>個性</td><td>HP</td><td>個性</td></tr>');
	f.write('<tr><td>'+p1[7]+'</td><td>'+pet_type(p1[6])+'</td><td>'+p1[7]+'</td><td>'+pet_type(m1[6])+'</td></tr>');
	f.write('<tr bgcolor="'+tr_bgcolor+'"><td>AT</td><td>MT</td><td>AT</td><td>MT</td></tr>');
	f.write('<tr><td>'+p1[2]+'</td><td>'+p1[3]+'</td><td>'+m1[2]+'</td><td>'+m1[3]+'</td></tr>');
	f.write('<tr bgcolor="'+tr_bgcolor+'"><td>DEF</td><td>出擊值</td><td>DEF</td><td>出擊值</td></tr>');
	f.write('<tr><td>'+p1[4]+'</td><td>'+p1[5]+'</td><td>'+m1[4]+'</td><td>'+m1[5]+'</td></tr>');
	f.write(temp_tebla2);
}
function pet_fdetial(dmg)
{
	var f=parent.wog_view.document;
	var p1=p.split(",");
	var m1=m.split(",");
	pet_pname=p1[0]+"-"+p1[1];
	pet_mname=m1[0]+"-"+m1[1];
	message_cls();
	f.write(temp_tebla1+'<tr ><td colspan="2" >'+pet_pname+'</td><td colspan="2" >'+pet_mname+'</td></tr>');
	f.write('<tr bgcolor="'+tr_bgcolor+'"><td>HP</td><td>個性</td><td>HP</td><td>個性</td></tr>');
	f.write('<tr><td>'+p1[6]+'</td><td>'+pet_type(p1[6])+'</td><td>'+m1[6]+'</td><td>'+pet_type(m1[6])+'</td></tr>');
	f.write('<tr bgcolor="'+tr_bgcolor+'"><td>AT</td><td>MT</td><td>AT</td><td>MT</td></tr>');
	f.write('<tr><td>'+p1[2]+'</td><td>'+p1[3]+'</td><td>'+m1[2]+'</td><td>'+m1[3]+'</td></tr>');
	f.write('<tr bgcolor="'+tr_bgcolor+'"><td>DEF</td><td>出擊值</td><td>DEF</td><td>出擊值</td></tr>');
	f.write('<tr><td>'+p1[4]+'</td><td>'+p1[5]+'</td><td>'+m1[4]+'</td><td>'+m1[5]+'</td></tr>');
	f.write(temp_tebla2);
}
function pet_pact(temp_d,s) 
{	
	temp_d=' <font color=red><b>'+temp_d+'<b></font>'
	pet_view_fight(temp_d,s,pet_pname,pet_mname);
}
function pet_mact(temp_d,s) 
{	
	temp_d=' <font color=red><b>'+temp_d+'<b></font>'
	pet_view_fight(temp_d,s,pet_mname,pet_pname);	
}
function pet_view_fight(temp_d,s,f,d)
{
	var ff=parent.wog_view.document;
	var fstr="";
	(f==pet_pname)?f='<font color="#89C7F3">'+f+'</font>':f='<font color="#81D8A8">'+f+'</font>';
	(d==pet_pname)?d='<font color="#89C7F3">'+d+'</font>':d='<font color="#81D8A8">'+d+'</font>';
	if(s=="1")
	{
		fstr="物理";
	}else if(s=="2")
	{
		fstr="魔力";
	}else if(s=="3")
	{
		fstr="複合";
	}
	ff.write(hr);
	ff.write(temp_tebla1+'<br><tr><td colspan="2" >'+f+' 發動'+fstr+'攻擊 給予 '+d+temp_d+' 點傷害</td></tr>');
	ff.write('</table>');
}
function pet_miss_date(f,d)
{	
	var ff=parent.wog_view.document;
	(f==pet_pname)?f='<font color="#89C7F3">'+f+'</font>':f='<font color="#81D8A8">'+f+'</font>';
	var s=new Array;
	s[0]=" 沒有擊中目標";
	s[1]=" 發呆";
	s[2]=" 東張西望";
	s[3]=" 失去鬥志";
	ff.write(hr);
	ff.write(temp_tebla1+'<br><tr><td colspan="2" >'+f+s[d]+'</td></tr>');
	ff.write(temp_tebla2);
}
function pet_end_date(s,en)
{	
	var f=parent.wog_view.document;
	var enstr="";
	if(en=="0")
	{
		enstr="戰敗了!!!";
	}else if(en=="1")
	{
		enstr="獲得了勝利！！";
	}
	f.write(hr);
	f.write(temp_tebla1+'<br><tr><td ><b>'+s+' '+enstr+'</b></td></tr>');
	f.write(temp_tebla2);
}
function pet_leave(id)
{
	if(confirm("確定放生?"))
	{
		foot_turn('pet','leave',id);
	}
}
function pet_detail(at,mt,def,hu,fu,he,fi)
{
	var f=parent.wog_view.document;
	message_cls();
	f.write(temp_tebla1);
	f.write('<tr><td>AT</td><td>MT</td><td>DEF</td><td>疲勞</td><td>飽腹</td><td>親密度</td><td>出擊值</td></tr>');
	f.write('<tr><td>'+at+'</td><td>'+mt+'</td><td>'+def+'</td><td>'+hu+'</td><td>'+fu+'</td><td>'+he+'</td><td>'+fi+'</td></tr>');
	f.write(temp_tebla2);
}
function pet_type(a)
{
	var s=new Array;
	s[0]="";
	s[1]="積極";
	s[2]="冷酷";
	s[3]="鐵壁";
	s[4]="危急";
	return s[a];
}
function wog_message_box(a,b,c){
	var rootEl=parent.wog_view.document.body;
	_docHeight=((rootEl.scrollTop==0)?rootEl.clientHeight:rootEl.scrollHeight);
	_docWidth=((rootEl.scrollLeft==0)?rootEl.clientWidth:rootEl.scrollWidth);
	_width=360;
	_height=10;
	var temp_ex="　";
	switch (b)
	{
		case 1: //道具類
		var s1=a.split(",");
		_width=460;
		_height=100;
			if(a!="")
			{
			temp_ex+='<table bgcolor="#4B689E" width=100% cellspacing="0" cellpadding="0"><tr><td><table width=100% cellspacing="1" cellpadding="1" bgcolor="#000000">';
			temp_ex+='<tr bgcolor="#4B689E"><td colspan="4">'+s1[22]+'：'+s1[0]+'</td></tr>';
			temp_ex+='<tr bgcolor="#4B689E"><td>物攻</td><td>物防</td><td>魔攻</td><td>魔防</td></tr>';
			temp_ex+='<tr><td>'+s1[1]+'</td><td>'+s1[2]+'</td><td>'+s1[3]+'</td><td>'+s1[4]+'</td></tr>';
			temp_ex+='<tr bgcolor="#4B689E"><td>速度</td><td>運氣</td><td>屬性</td><td>職業</td></tr>';
			temp_ex+='<tr><td>'+s1[5]+'</td><td>'+s1[6]+'</td><td>'+s1[7]+'</td><td>'+s1[8]+'</td></tr>';
			temp_ex+='<tr bgcolor="#4B689E"><td>力量</td><td>智力</td><td>體質</td><td>信仰</td></tr>';
			temp_ex+='<tr><td>'+s1[9]+'</td><td>'+s1[10]+'</td><td>'+s1[11]+'</td><td>'+s1[12]+'</td></tr>';
			temp_ex+='<tr bgcolor="#4B689E"><td>生命</td><td>魅力</td><td>裝備</td><td>道具</td></tr>';
			temp_ex+='<tr><td>'+s1[13]+'</td><td>'+s1[14]+'</td><td>'+s1[15]+'</td><td>'+s1[16]+'</td></tr>';
			temp_ex+='<tr bgcolor="#4B689E"><td colspan="2" width=50%>EXP</td><td colspan="2" width=50%>限制</td></tr>';
			temp_ex+='<tr><td colspan="2" width=50%>'+s1[17]+'</td><td colspan="2" width=50%>力:'+s1[18]+' 速:'+s1[19]+' 智:'+s1[20]+' LV:'+s1[21]+'</td></tr></table></td></tr></table>';
			}
		break;
		case 2: //職業奧義
		var s1=a.split(",");
		_width=460;
		_height=100;
			if(a!="")
			{
			temp_ex+='<table bgcolor="#4B689E" width=100% cellspacing="0" cellpadding="0"><tr><td><table width=100% cellspacing="1" cellpadding="1" bgcolor="#000000">';
			temp_ex+='<tr bgcolor="#4B689E"><td colspan="5">'+s1[0]+'</td></tr>';
			temp_ex+='<tr bgcolor="#4B689E"><td colspan="5">自身能力所乘倍數</td></tr>';
			temp_ex+='<tr bgcolor="#4B689E"><td>物攻</td><td>物防</td><td>魔攻</td><td>魔防</td><td>速度</td></tr>';
			temp_ex+='<tr><td>'+s1[1]+'</td><td>'+s1[2]+'</td><td>'+s1[3]+'</td><td>'+s1[4]+'</td><td>'+s1[5]+'</td></tr>';
			temp_ex+='<tr bgcolor="#4B689E"><td colspan="5">敵人能力所乘倍數</td></tr>';
			temp_ex+='<tr bgcolor="#4B689E"><td>物攻</td><td>物防</td><td>魔攻</td><td>魔防</td><td>速度</td></tr>';
			temp_ex+='<tr><td>'+s1[6]+'</td><td>'+s1[7]+'</td><td>'+s1[8]+'</td><td>'+s1[9]+'</td><td>'+s1[10]+'</td></tr>';
			temp_ex+='<tr bgcolor="#4B689E"><td colspan="5">自身其他數值加乘</td></tr>';
			temp_ex+='<tr bgcolor="#4B689E"><td>HP</td><td>命中</td><td>迴避</td><td>必殺</td><td>連擊</td></tr>';
			temp_ex+='<tr><td>'+s1[11]+'</td><td>'+s1[12]+'</td><td>'+s1[13]+'</td><td>'+s1[14]+'</td><td>'+s1[15]+'</td></tr></table></td></tr></table>';
			}
		break;
		case 3: //合成信息
			temp_ex+='<table bgcolor="#4B689E" width=100% cellspacing="0" cellpadding="0"><tr><td><table width=100% cellspacing="1" cellpadding="1" bgcolor="#000000">';
			temp_ex+='<tr bgcolor="#4B689E"><td>製作「'+c+'」需要下列物品</td></tr>';
			temp_ex+='<tr><td>'+a+'</td></tr>';
			temp_ex+='</table></td></tr></table>';
		break;
		case 0: //任務信息
			_width=620;
			a=a.replace(/&n/g,"<br>");
			temp_ex+='<table bgcolor="#4B689E" width=100% cellspacing="0" cellpadding="0"><tr><td><table width=100% cellspacing="1" cellpadding="1" bgcolor="#000000">';
			temp_ex+='<tr><td class=b1>'+a+'</td></tr>';
			temp_ex+='</table></td></tr></table>';
		break;
	}
	_docHeight=(_docHeight/3)-(_height/2);
	_docWidth=(_docWidth/2)-(_width/2);
	var wog_message_box_html='';
	wog_message_box_html+='<table border="0" cellspacing="0" cellpadding="0"><tr><td style="width: '+_width+';">';
	wog_message_box_html+='<div style="position:absolute; left: '+_docWidth+'; top: '+_docHeight+'; Z-INDEX: 1000;filter: Alpha(style=0,opacity=0);width: '+_width+';"><iframe id="DivShim" src="javascript:false;" scrolling="no" frameborder="0" ></iframe></div>';
	wog_message_box_html+='<div style="position:absolute; left: '+_docWidth+'; top: '+_docHeight+'; Z-INDEX: 1002;width: '+_width+';">';
	wog_message_box_html+='<table border="0" bgcolor="#555555" cellspacing="0" cellpadding="1" width=100%>';
	wog_message_box_html+='<tr><td valign="top"><table width=100% border="0"  cellspacing="0" cellpadding="1" >';
	wog_message_box_html+='<tr><td width=88% height="1">　</td><td valign="top" width="54" style="cursor: hand" height="1">';
	wog_message_box_html+='<a href="javascript:parent.hidebox(\'wog_message_box\');" target="mission"><font size="2" color="#FFFFFF">關閉</font></a></td></tr>';
	wog_message_box_html+='<tr><td width=100% bgcolor="#000000" colspan="2" height="100%" valign="top">'+temp_ex+'</td></tr>';
	wog_message_box_html+='<tr><td width=88% height="1">　</td><td valign="top" width="54" style="cursor: hand" height="1">';
	wog_message_box_html+='<a href="javascript:parent.hidebox(\'wog_message_box\');" target="mission"><font size="2" color="#FFFFFF">關閉</font></a></td></tr>';
	wog_message_box_html+='</table></table></div></td></tr></table>';
	parent.wog_view.document.getElementById("wog_message_box").innerHTML=wog_message_box_html;
	parent.wog_view.document.getElementById("wog_message_box").style.display="block";
}
function hidebox(a){
	if(parent.wog_view.document.getElementById("wog_message_box"))
	{
		parent.wog_view.document.getElementById("wog_message_box").style.display="none";
	}
	if(parent.wog_view.document.getElementById("DivShim"))
	{
		parent.wog_view.document.getElementById("DivShim").style.display="none";
	}
}

//###### mission #######
function mission_list(saletotal,page,s,store_id)
{
	Sookie("wog_mission_view",store_id)
	var f=parent.wog_view.document;
	message_cls();
	mission_ed(store_id);
	f.write('<tr>');
	f.write('<form action="wog_act.php" method="post" name=pageform target="mission">');
	pagesplit(saletotal,page);
	f.write('</tr>');
	f.write('<input type="hidden" name="page" value="">');	
	f.write('<input type="hidden" name="f" value="mission">');	
	f.write('<input type="hidden" name="act" value="'+store_id+'">');
	f.write('</form>');
	f.write('<form action="wog_act.php" method="post" target="mission" name=f1 >');
	f.write(temp_tebla1);
	f.write('<tr bgcolor="#4B689E"><td>選擇</td><td>委託者</td><td>任務主題</td><td>截止時間</td></tr>');
	if(s!="")
	{
		var s1=s.split(";");
		var temp_s="";
		for(var i=0;i<s1.length;i++)
		{
			var s2=s1[i].split(",");
			f.write('<tr onMouseOver="this.style.backgroundColor=\'#0000CD\'" onMouseOut="this.style.backgroundColor=\'\'" onclick="parent.setRadioValue(\'m_id\','+s2[0]+');" style="cursor:hand"><td ><input type="radio" name="m_id" value="'+s2[0]+'"></td><td>'+s2[1]+'</td><td><a href="javascript:parent.act_click(\'mission\',\'detail\','+s2[0]+')">'+s2[2]+'</a></td><td>'+s2[3]+'</td></tr>');
		}
		f.write('<tr><td colspan="4"><input type="submit" value="接受任務"></td></tr>');
		f.write(temp_tebla2);
		f.write('<input type="hidden" name="f" value="mission">');
		f.write('<input type="hidden" name="act" value="get">');
	}else
	{
		f.write('<tr><td colspan="4" align="center">目前無任務</td></tr>');
		f.write(temp_tebla2);
	}
	f.write('</form>');
	f.write('<span id="wog_message_box"></span>');
}
function mission_book(json)
{
	Sookie("wog_mission_view","7")
	message_cls();
	mission_ed('7');
	var f=parent.wog_view.document;
	if(json.length>0){
		for(var i=0,mission;mission=json[i];i++){
			f.write('<form action="wog_act.php" method="post" target="mission" name=f1>');
			f.write(temp_tebla1);
			f.write('<tr><td>委託者：'+mission[2]+'</td></tr>');
			f.write('<tr><td><a href="javascript:parent.act_click(\'mission\',\'detail\','+mission[0]+')">'+mission[1]+'</a></td></tr>');
			if(mission[3] && parseInt(mission[4],10)>0){
				f.write('<tr><td>擊倒：'+mission[3]+' 剩餘 '+mission[4]+' 隻</td></tr>');
			}
			if(mission[5]){
				f.write('<tr><td>※這是限時任務，剩餘時間：'+Math.ceil(parseInt(mission[5],10)/3600)+' 小時</td></tr>');
			}
			f.write('<tr><td ><input type="button" value="完成任務" onClick="parent.foot_turn(\'mission\',\'end\',\'\','+mission[0]+',\'\')"> <input type="button" value="放棄任務" onClick="parent.foot_turn(\'mission\',\'break\',\'\','+mission[0]+',\'\')"></td></tr>');
			f.write(temp_tebla2);
			f.write('</form><br/>');
			}
		f.write('<span id="wog_message_box"></span>');
	}else{
		f.write(temp_tebla1+'<br><tr><td style="font-weight:bold;font-size:20;">目前無任務進行中</td></tr>'+temp_tebla2); 
	}
}
function mission_achieve(a,b)
{
	var f=parent.wog_view.document;
	f.write(hr);
	f.write(fight_temp_tebla1+'<br><tr><td ><b>任務進度：'+m_name+' '+a+'/'+b+'</b></td></tr>');
	f.write(temp_tebla2);
	parent.wog_view.scroll(0,f.body.scrollHeight);
}
function npc_message(message,a,b)
{
	var f=parent.wog_view.document;
	f.write(hr);
	while(message.indexOf("&n") > 0)
	{
		message=message.replace("&n","<br>");
	}
	f.write(temp_tebla1+'<tr><td ><b>發現：'+m_name+' '+a+'/'+b+'</b></td></tr><tr><td class=b1>'+message+'</td></tr>');
	f.write(temp_tebla2);
	parent.wog_view.scroll(0,f.body.scrollHeight);
}
function mission_paper(saletotal,page,s)
{
	Sookie("wog_mission_view","8")
	var f=parent.wog_view.document;
	message_cls();
	mission_ed('8');
	f.write('<form action="wog_act.php" method="post" name=pageform target="mission">');
	pagesplit(saletotal,page);
	f.write('<input type="hidden" name="page" value="">');	
	f.write('<input type="hidden" name="f" value="mission">');	
	f.write('<input type="hidden" name="act" value="paper">');
	f.write('</form>');
	f.write(temp_tebla2+hr);
	f.write(temp_tebla1);
	f.write('<tr bgcolor="#4B689E"><td>委託者</td><td>任務主題</td></tr>');
	if(s!="")
	{
		var s1=s.split(";");
		for(var i=0;i<s1.length;i++)
		{  
			var s2=s1[i].split(",");
			f.write('<tr><td>'+s2[0]+'</td><td>'+s2[1]+'</td></tr>');
		}
	}else{
		f.write('<tr><td colspan="4">目前無任務</td></tr>');
	}
	f.write(temp_tebla2);
}
function mission_ed(temp_s)
{
	var f=parent.wog_view.document;
	f.write(temp_tebla1+'<tr>');
	f.write('<td colspan="6" bgcolor="#4B689E">任 務 中 心</td></tr>');
	f.write('<tr><td '+(temp_s!="1"?changelink+' onClick="parent.act_click(\'mission\',\'1\')"':'bgcolor="#3366FF"')+'>老牙仕事所</td>');
	f.write('<td '+(temp_s!="2"?changelink+' onClick="parent.act_click(\'mission\',\'2\')"':'bgcolor="#3366FF"')+'>黑街仕事所</td>');
	f.write('<td '+(temp_s!="3"?changelink+' onClick="parent.act_click(\'mission\',\'3\')"':'bgcolor="#3366FF"')+'>銀鯨仕事所</td>');
	f.write('<td '+(temp_s!="4"?changelink+' onClick="parent.act_click(\'mission\',\'4\')"':'bgcolor="#3366FF"')+'>孤貓仕事所</td>');
	f.write('<td '+(temp_s!="5"?changelink+' onClick="parent.act_click(\'mission\',\'5\')"':'bgcolor="#3366FF"')+'>時間任務所</td>');
	f.write('<td '+(temp_s!="6"?changelink+' onClick="parent.act_click(\'mission\',\'6\')"':'bgcolor="#3366FF"')+'>空間任務所</td></tr>');
	f.write('<tr><td colspan="3" '+(temp_s!="7"?changelink+' onClick="parent.act_click(\'mission\',\'book\')"':'bgcolor="#3366FF"')+'>未完成任務</td>');
	f.write('<td colspan="3" '+(temp_s!="8"?changelink+' onClick="parent.act_click(\'mission\',\'paper\')"':'bgcolor="#3366FF"')+'>已完成任務</td>');
	f.write('</tr>'+temp_tebla2);
}
function mission_chose()
{
	var temp_s=Gookie("wog_mission_view");
	if(temp_s == null)
	{
		var temp_s='1';
	}
	switch(temp_s)
	{
		case '1':
			act_click('mission','1');
		break;
		case '2':
			act_click('mission','2');
		break;
		case '3':
			act_click('mission','3');
		break;
		case '4':
			act_click('mission','4');
		break;
		case '5':
			act_click('mission','5');
		break;
		case '6':
			act_click('mission','6');
		break;
		case '7':
			act_click('mission','book');
		break;
		case '8':
			act_click('mission','paper');
		break;
	}
}
//###### event begin ######
function event(etime) 
{ 
	var f=parent.wog_view.document;
	message_cls(); 
	var now_time=new Date();
	f.write(temp_tebla1); 
	f.write('<form action="wog_act.php" method="post" target="mission">'); 
	f.write('<tr><td>站長要考驗大家是否有手動在玩</td></tr>'); 
	f.write('<tr><td><font color="yellow">↓ 請於 <b>'+etime+'</b> 秒內作答 (原值600秒) ↓</font></td></tr>');
	f.write('<tr><td colspan="2"><img src="captcha/code.php" id="captcha"><br><a href=javascript:parent.recode();>看不清楚，重新獲取驗證碼</a></td></tr>');  
	f.write('<tr><td>請輸入安全驗證碼:<input type="text" name="sec_code" size="8" maxlength="5">(不分大小寫)</td></tr>'); 
	f.write('<tr><td><font color="red">→ 答錯五次 或 沒有在限定時間內答對，將會鎖帳一天 ←</font></td></tr>');
	f.write('<tr><td colspan="2"><input class="text" type="button" value="填好答案了,放我過關吧!!" onClick="parent.foot_turn(\'event\',\'\',this.form.sec_code.value,\'\')"></td></tr>'); 
	f.write('</form>'); 
	f.write(temp_tebla2); 
} 
function recode()
{
	var f=parent.wog_view.document;
	var now_time=new Date();
	f.getElementById("captcha").src=f.getElementById("captcha").src +'?'+now_time.getMilliseconds();
}
//###### message ####### 
function message() 
{ 
   var f=parent.wog_view.document; 
   message_cls(); 
   f.write(temp_tebla1); 
   f.write('<form action="wog_act.php" method="post" target="mission">'); 
   f.write('<tr><td colspan="2" bgcolor="#4B689E">緣 份 郵 局</td></tr>');
   f.write('<tr><td>對像帳號</td><td class="b1"><input type="text" name="name" size="12" value=""></td></tr>'); 
   f.write('<tr><td>內容</td><td class="b1"><textarea cols="30" rows="7" name="body"></textarea></td></tr>'); 
   f.write('<tr><td colspan="2"><input type="button" value="寄 出 郵 件" onClick="parent.foot_turn(\'message\',1,this.form.name.value,this.form.body.value)"></td></tr>'); 
   f.write('<tr><td colspan="2">信件內容請不要超過150字元 及 涉及違規信息，謝謝！</td></tr>'); 
   f.write('</form>'); 
   f.write(temp_tebla2); 
}
//###### race begin ######
function race_view(s,p_name,p_money)
{
	message_cls();
	var f=parent.wog_view.document;
	f.write('<form action="wog_etc.php?f=race&act=end" method="post" target="mission" name="f1" >');
	f.write(temp_tebla1);
	f.write('<tr><td >'+p_name+'</td><td colspan="4" >現金 '+p_money+' | 賠率 1 : 5 | 最小賭注 100 最大賭注 100000</td></tr>');
	f.write('<tr><td >閘位</td><td >照片</td><td >鳥名</td><td >必殺技</td><td >選擇</td></tr>');
	var s1=s.split(";");
	var temp_s="";
	for(var i=0;i<s1.length;i++)
	{	
		var s2=s1[i].split(",");
		temp_s+=","+s2[2];
		f.write('<tr><td ><b>'+(i+1)+'</b></td><td ><IMG src="'+img+'horse/cho'+(i+1)+'.gif" ></td><td >'+s2[0]+'</td><td >'+s2[1]+'</td><td ><input type="radio" name="yourchoose" value="'+s2[2]+'" ></td></tr>');
	}
	f.write('<tr><td  colspan="5" >下注金額 <input type="text" name="money" size="8" maxlength="8"> <input type="submit" value="確定"> </td></tr>');
	f.write(temp_tebla2);
	temp_s=temp_s.substr(1,temp_s.length);
	f.write('<input type="hidden" name="temp_id" value="'+temp_s+'">');
	f.write('</form>');
}
function race_end(s,a,b,f,winer)
{
	message_cls();
	var ff=parent.wog_view.document;
	ff.write('<br>');
	ff.write('<table width=100% border=0 cellspacing=1 cellpadding=5 bgcolor=#4B689E>');
	var s1=s.split(",");
	for(var i=0;i<s1.length;i++)
	{	
		ff.write('<div id=h'+(i+1)+' style=position:absolute;top:'+(35+(i*40))+'px><img src='+img+'horse/cho'+(i+1)+'.gif></div>');
		ff.write('<tr bgcolor=#000000 align=right><td height=39 width=10>'+(i+1)+'</td><td width='+f+'></td><td>'+s1[i]+'</td></tr>');
	}
	ff.write(temp_tebla2);
	ff.write('<div id=sysMsg style=position:absolute;width:250;height:30%;left:40%;>');
	ff.write('<table width="100%" border="0" cellspacing="1" cellpadding="3" ><tr><td colspan=2  align=center>比賽結果公佈 --- '+b+'</td></tr><tr> <td width="40%" align=center>第１名：</td><td width="60%" align=center>'+winer+'</td> </tr></table></div>');
	Horse_timelinePlay('horse',null,a);
}
function Horse_timelinePlay(tmLnName, myID,a) {
var view_name=parent.wog_view.document;
if (view_name.Horse_Time == null) Horse_initTimelines(a);
tmLn = view_name.Horse_Time[tmLnName];
if(myID == null) { myID = ++tmLn.ID; firstTime=true;}
setTimeout('Horse_timelinePlay("'+tmLnName+'",'+myID+')',tmLn.delay);
fNew = ++tmLn.curFrame;
for (i=0; i<tmLn.length; i++) {
sprite = tmLn[i];
if (sprite.obj) {
numKeyFr = sprite.keyFrames.length; firstKeyFr = sprite.keyFrames[0];
if (fNew >= firstKeyFr && fNew <= sprite.keyFrames[numKeyFr-1]) {
keyFrm=1;
for (j=0; j<sprite.values.length; j++) {
props = sprite.values[j];
if (numKeyFr != props.length) {
if (props.prop2 == null) sprite.obj[props.prop] = props[fNew-firstKeyFr];
else sprite.obj[props.prop2][props.prop] = props[fNew-firstKeyFr];
}else{
while (keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]) keyFrm++;
if (firstTime || fNew==sprite.keyFrames[keyFrm-1]) {
if (props.prop2 == null) sprite.obj[props.prop] = props[keyFrm-1];
else sprite.obj[props.prop2][props.prop] = props[keyFrm-1];
}}}}
}}
}
function Horse_initTimelines(a) {
var view_name=parent.wog_view.document;
view_name.Horse_Time = new Array();
view_name.Horse_Time[0] = new Array();
view_name.Horse_Time["horse"] = view_name.Horse_Time[0];
var s1=a.split(";");
for(var i=0;i<s1.length;i++)
{	
	view_name.Horse_Time[0][i]=new String("sprite");
	view_name.Horse_Time[0][i].obj=view_name.all ? view_name.all["h"+(i+1)] : null;
	view_name.Horse_Time[0][i].keyFrames=new Array(1,30);
	view_name.Horse_Time[0][i].values=new Array(2);
	view_name.Horse_Time[0][i].values[0]=new Array();
	var s2=s1[i].split(",");
	for(var j=0;j<s2.length;j++)
	{
		view_name.Horse_Time[0][i].values[0][j]=parseInt(s2[j]);
	}
	view_name.Horse_Time[0][i].values[0].prop="left";
	view_name.Horse_Time[0][i].values[1]=new Array();
	view_name.Horse_Time[0][i].values[0].prop2="style";
}
view_name.Horse_Time[0][s1.length]=new String("sprite");
view_name.Horse_Time[0][s1.length].obj = view_name.all ? view_name.all["sysMsg"] : null;
view_name.Horse_Time[0][s1.length].keyFrames=new Array(1,30);
view_name.Horse_Time[0][s1.length].values=new Array();
view_name.Horse_Time[0][s1.length].values[0]=new Array();
view_name.Horse_Time[0][s1.length].values[0].prop="left";
view_name.Horse_Time[0][s1.length].values[1]=new Array();
view_name.Horse_Time[0][s1.length].values[0]=new Array("hidden","inherit");
view_name.Horse_Time[0][s1.length].values[0].prop="visibility";
view_name.Horse_Time[0][s1.length].values[0].prop2="style";
for(i=0;i<view_name.Horse_Time.length;i++){view_name.Horse_Time[i].curFrame=0;view_name.Horse_Time[i].delay=200;}
}
function wog_broad(s)
{
	parent.top_view.document.getElementById("a1").innerHTML='<marquee loop="" scrollamount="3" scrolldelay="0">'+s+'</marquee>';
}
function p1()
{
	parent.peolist.document.location.reload();
	window.setTimeout("p1()",30000); 
}
window.setTimeout("p1()",30000);
function rechat_confirm(reno,all,money) 
{
	message_cls(); 
	var f=parent.wog_view.document; 
	f.write('<form method="POST" action="wog_act.php">'); 
	f.write(temp_tebla1); 
	f.write('<td bgcolor="#4B689E">更 改 頭 銜</td>');
	f.write('<tr><td>你是第 <font color="ccffff">'+reno+'</font> 次修改頭銜，故需要 <font color="ccffff">'+all+'</font> 次轉生和現金 <font color="ccffff">'+money+'</font> 元</td></tr>'); 
	f.write('<tr><td>頭銜：<input type="text" name="name" size="10" maxlength="6"> - 注意：字數限制：6 位</td></tr>'); 
	f.write('<tr><td>色碼：<input type="text" name="color" size="10" maxlength="6"> - 注意：錯誤色碼成黑色</td></tr>'); 
	f.write('<tr><td>色碼選擇圖 - <a href="'+img+'rgb.gif" target="_blank"><font color="ff3333">點擊觀看</font></a></td></tr>'); 
	f.write('<tr><td><input type="button" value="確 定 更 改" onClick="parent.act_click(\'count\',\'rechat\',this.form.name.value,this.form.color.value)"></td></tr>'); 
	f.write('<tr><td>說明：每一次更改頭銜，就會增加４次轉生次數限制和需付２千萬。第一次修改免費！</td></tr>'); 
	f.write(temp_tebla2); 
	f.write('</form>'); 
}
function reluck() 
{ 
   var f=parent.wog_view.document; 
   message_cls(); 
   f.write(temp_tebla1); 
   f.write('<form action="wog_act.php" method="post" target="mission">'); 
   f.write('<tr>');
   f.write('<td width="50%" bgcolor="#4B689E">初階轉運</td>');
   f.write('<td width="50%" bgcolor="#4B689E">進階轉運</td>');
   f.write('</tr>');
   f.write('<tr>');
   f.write('<td>轉運費用：十億，增加運氣：（-40~50），注意：自身運氣超過250則不可以轉運！');
   f.write('<td>轉運費用：一百億，增加運氣：+200/-100，注意：自身運氣需到達1000而且不得超過2000，否則不可以轉運！</td>');
   f.write('</tr>');
   f.write('<tr><td colspan="2"><img src="http://img.photobucket.com/albums/v721/gn02099009/140075490_24d11187bb.jpg"></td></tr>'); 
   f.write('<tr><td><input type="button" value="確定進行初階轉運" onClick="parent.act_click(\'chara\',\'reluck\')"></td>');
   f.write('<td><input name="button" type="button" onClick="parent.act_click(\'chara\',\'reluck2\')" value="確定進行進階轉運"></td></tr>');
   f.write('</form>'); 
   f.write(temp_tebla2); 
}
function rebirth_confirm(rebirth_money,rebirth_lv,basic,total_point) 
{ 
   message_cls(); 
   temp_st=new Array("str","smart","life","agl"); 
   var f=parent.wog_view.document; 
   f.write('<form method="POST" action="wog_act.php">'); 
   f.write('<INPUT TYPE="hidden" NAME="act" VALUE="rebirth"><INPUT TYPE="hidden" NAME="f" VALUE="rebirth">'); 
   f.write('<p align="center"><font color="#FF0000"><b>轉生需付'+rebirth_money+'元，等級須達到'+rebirth_lv+'等</b></font></p>'); 
   f.write('<p align="center"><font color="#FF0000"><b>重點注意：最好轉生前先將身上的裝備卸下，若有損失不獲賠償。</b></font></p>'); 
   f.write('<p align="center"><font color="#FF0000"><b>轉生後請按重新登入，資料才會刷新</b></font></p>'); 
   f.write('<p align="center"><tr><td class="b1">重設角色屬性：<input type="radio" name="s" value="1">地 <input type="radio" name="s" value="2">水 <input type="radio" name="s" value="3">火 <input type="radio" name="s" value="4">木 <input type="radio" name="s" value="5">風 <input type="radio" name="s" value="6">毒</td></tr></p>'); 
   f.write('<p align="center">轉生地點：<input type="radio" name="b" value="1">中央大陸　<input type="radio" name="b" value="2">魔法王國　<input type="radio" name="b" value="3">熱帶雨林　<input type="radio" name="b" value="4">末日王城</p>');
   f.write('<p align="center"><tr><td class="b1">重設角色能力： 基本值 '+basic+'<table border="1" cellspacing="0" cellpadding="0"><tr><td class="b1" width="70">力量 '+basic+'</td><td class="b1" width="70">智力 '+basic+'</td><td class="b1" width="70">體力 '+basic+'</td><td class="b1" width="70">敏捷 '+basic+'</td></tr>'); 
   f.write('<tr>'); 
   for(var j=0;j<4;j++) 
   { 
      f.write('<td class="b1"><select name='+temp_st[j]+'>'); 
      for(var i=0;i<16;i++) 
      { 
         f.write('<option value="'+i+'">+'+i); 
      } 
      f.write('</select></td>'); 
   } 
   f.write('</tr></table></p>'); 
   f.write('<p align="center"><tr><td class="b1">★你共有「<font color="#FF0000"><b>'+total_point+'</b></font>」點的加分點數可增加能力值，請自行分配。分配總和超出<font color="#FF0000"><b>'+total_point+'</b></font>以上則無法註冊。</td></tr></p>'); 
   f.write('<p align="center"><font color="#FF0000"><b>按下確認鈕確認轉生,若不轉生請勿點選!!</b></font></p>'); 
   f.write('<p align="center"><input type="submit" value="確認轉生"></p>'); 
   f.write('</form>'); 
} 

function rebirth_end(a) 
{ 
   message_cls(); 
   var f=parent.wog_view.document; 
   var s=new Array; 
   s[1]="您未達到指定等級"; 
   s[2]="金錢不足"; 
   s[3]="這次的轉生失敗了";    
   s[4]="您已經重獲新生了"; 
   s[5]="已分配潛能成功"; 
   f.write(temp_tebla1); 
   f.write('<tr><td >'+s[a]+'!!</td></tr>') 
   f.write(temp_tebla2); 
}

function setRadioValue(){ 
   var result=false; 
   if(arguments.length==2){ 
      result=_setRadioValue(arguments[0],arguments[1]); 
   }else if(arguments.length==1 && typeof arguments[0] == 'object'){ 
      for(var i in arguments[0]){ 
         _setRadioValue(i,arguments[0][i]); 
      } 
      result=true; 
   } 
   return result; 
} 
function _setRadioValue(name,value){ 
   var result=false; 
   var list=parent.wog_view.document.getElementsByName(name); 
   for(var i=0;i<list.length;i++){ 
      if(list[i].value==value){ 
         list[i].checked=true; 
         result=true; 
      }else{ 
         list[i].checked=false; 
      } 
   } 
   return result; 
}
function load_img(imgsrc,w_limit,h_limit)
{
	Pimg.src=imgsrc; 
	width=Pimg.width; 
	height=Pimg.height; 
	if(width*h_limit >= height*w_limit && width > w_limit) 
	{ 
		height = Math.floor(height * w_limit/width) ; 
		width = Math.floor(width * w_limit/width) ; 
	} 
	if(height*w_limit >= width*h_limit && height > h_limit) 
	{	 
		width = Math.floor(width * h_limit/height) ; 
		height = Math.floor(height * h_limit/height) ; 
	}
	return;
}
function form_send(f)
{
   var frm=parent.foot.document.f2;
   while(i=frm.children[0])
   frm.removeChild(i);
   var len=f.elements.length;
   var btn_log=new Array();
   for(var l=0;l < len;l++)
   {
      var temp_s="";
      var btn_check=false;
      var i=f.elements[l];
      var btn_name=i.name;
      if(btn_name == "")continue;
      for(var n=0;n < btn_log.length;n++)
      {
         if(btn_name == btn_log[n])
         {
            btn_check=true;
            break;
         }
      }
      if(btn_check == false)
      {
         var btn_tagname=(i.tagName).toLowerCase();
         if(btn_tagname=="select")btn_tagname="input";
         var btn=parent.foot.document.createElement(btn_tagname);
         var btn_type=(i.type).toLowerCase();
         btn.name=btn_name;
         //btn.type="hidden";
         if(btn_type == "radio" || btn_type == "checkbox")
         {
            var item=f.all(btn_name);
            for(var j=0;j<item.length;j++)
            {
               if(item[j].checked==true)
               {
                  temp_s+=","+item[j].value;
               }         
            }
            temp_s=temp_s.substr(1,temp_s.length);
            btn.value=temp_s;
         }else
         {
            btn.value=i.value;
         }
         frm.appendChild(btn);
         btn_log.push(btn_name);
      }
   }
   frm.action="wog_act.php";
   frm.method="POST";
   frm.target="mission";
   frm.submit();
}

function skill_view(s,temp_id,ss)
{
	message_cls();
	group_choose();
	var f=parent.wog_view.document;
	f.write(temp_tebla1);
	f.write('<form action="wog_act.php" method="post" name="f1" target="mission">');
	f.write('<br><tr><td colspan=2 bgcolor="#4B689E"><b>技 能 學 堂</b></td></tr>');
	f.write('<tr><td colspan="10">');
	for(var i=1;i<=5;i++)
	{
		f.write('<input type="button" value="LV '+i+'" class="b3" onClick="parent.th_submit2(document.f1,'+i+')" '+(i==temp_id?'disabled':'')+'> ');
	}
	f.write('</td></tr>');
	f.write('<input type="hidden" name="f" value="group">');
	f.write('<input type="hidden" name="act" value="skill_view">');
	f.write('<input type="hidden" name="temp_id" value="">');
	f.write('</form>');
	f.write(temp_tebla2);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write(temp_tebla1);
	f.write('<tr bgcolor="#4B689E"><td>選擇</td><td>物攻</td><td>魔攻</td><td>物防</td><td>魔防</td><td>速度</td><td>等級</td><td>學習需求</td><td>名稱</td><td>價格</td></tr>');
	if(s!="")
	{
		var s1=s.split(";");
		for(var i=0;i<s1.length;i++)
		{
			var s2=s1[i].split(",");
			f.write('<tr onMouseOver="this.style.backgroundColor=\'#0000CD\'" onMouseOut="this.style.backgroundColor=\'\'" onclick="parent.setRadioValue(\'adds\','+s2[0]+');" style="cursor:hand"><td ><input type="radio" name="adds" value="'+s2[0]+'"></td><td>'+s2[2]+'</td><td>'+s2[4]+'</td><td>'+s2[3]+'</td><td>'+s2[5]+'</td><td>'+s2[6]+'</td><td>'+s2[7]+'</td><td>等級:'+s2[8]+' 經驗:'+s2[9]+' 前置等級:'+s2[11]+'</td><td>'+s2[1]+'</td><td>'+s2[10]+'</td></tr>');
		}
	}else
	{
		f.write('<tr><td colspan="10" >沒有可以學習的技能</td></tr>');	
	}
	var s1=ss.split(",");
	f.write('<tr><td colspan="10" ><input type="submit" value="確 定 學 習"></td></tr>');
	f.write('<tr><td colspan="2" bgcolor="#4B689E">公會經驗<br>公會存款</td><td colspan="8" ><div id="show_message">'+s1[1]+'<br>'+s1[2]+'</div></td></tr>');
	f.write(temp_tebla2);
	f.write('<input type="hidden" name="f" value="group">');	
	f.write('<input type="hidden" name="act" value="skill_buy">');
	f.write('<input type="hidden" name="temp_id" value="'+temp_id+'">');
	f.write('</form>');
	f.write('<span id="wog_message_box"></span>');
}
function group_skill_use(s,ss)
{
	message_cls();
	group_choose();
	var f=parent.wog_view.document;
	f.write(temp_tebla1);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<br><tr><td colspan=9 bgcolor="#4B689E"><b>公 會 技 能</b></td></tr>');
	f.write('<tr bgcolor="#4B689E"><td>選擇</td><td>物攻</td><td>魔攻</td><td>物防</td><td>魔防</td><td>速度</td><td>等級</td><td>名稱</td></tr>');
	if(s!="")
	{
		var s1=s.split(";");
		for(var i=0;i<s1.length;i++)
		{
			var s2=s1[i].split(",");
			f.write('<tr onMouseOver="this.style.backgroundColor=\'#0000CD\'" onMouseOut="this.style.backgroundColor=\'\'" onclick="parent.setRadioValue(\'adds\','+s2[0]+');" style="cursor:hand"><td ><input type="radio" name="adds" value="'+s2[0]+'"></td><td>'+s2[1]+'</td><td>'+s2[2]+'</td><td>'+s2[3]+'</td><td>'+s2[4]+'</td><td>'+s2[5]+'</td><td>'+s2[6]+'</td><td>'+s2[7]+'</td></tr>');
		}
	}else
	{
		f.write('<tr><td colspan="9" >沒有可以使用的技能</td></tr>');	
	}
	var s1=ss.split(",");
	f.write('<tr><td colspan="9" >請輸入使用時間:<input type="text" name="use_time" size="2" maxlength="2" value="1">小時，每小時扣個人貢獻度100（時間不能疊加）</td></tr>');
	f.write('<tr><td colspan="9" ><input type="submit" value="確 定 使 用"></td></tr>');
	f.write('<tr><td colspan="2" bgcolor="#4B689E">個人貢獻度</td><td colspan="7" ><div id="show_message"> '+s1[0]+'</div></td></tr>');
	f.write(temp_tebla2);
	f.write('<input type="hidden" name="f" value="group">');	
	f.write('<input type="hidden" name="act" value="skill_use_ok">');
	f.write('</form>');
}
function group_depot_view(a,d,item_type,a1)
{
	var f=parent.wog_view.document;
	message_cls();
	vData=d;
	group_choose();
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write(temp_tebla1);
	f.write('<tr><td colspan="2" bgcolor="#4B689E">公 會 倉 庫</td></tr><tr><td><input type="button" value="武器" onclick="parent.act_click(\'group\',\'depot_view\',\'a_id\')" '+(item_type=='a_id'?'disabled':'')+'> <input type="button" value="頭部" onclick="parent.act_click(\'group\',\'depot_view\',\'d_head_id\')" '+(item_type=='d_head_id'?'disabled':'')+'> <input type="button" value="身體" onclick="parent.act_click(\'group\',\'depot_view\',\'d_body_id\')" '+(item_type=='d_body_id'?'disabled':'')+'> <input type="button" value="手部" onclick="parent.act_click(\'group\',\'depot_view\',\'d_hand_id\')" '+(item_type=='d_hand_id'?'disabled':'')+'> <input type="button" value="腳部" onclick="parent.act_click(\'group\',\'depot_view\',\'d_foot_id\')" '+(item_type=='d_foot_id'?'disabled':'')+'> <input type="button" value="道具" onclick="parent.act_click(\'group\',\'depot_view\',\'d_item_id\')" '+(item_type=='d_item_id'?'disabled':'')+'> <input type="button" value="座騎" onclick="parent.act_click(\'group\',\'depot_view\',\'d_ride_id\')" '+(item_type=='d_ride_id'?'disabled':'')+'> <input type="button" value="精靈" onclick="parent.act_click(\'group\',\'depot_view\',\'d_spirit_id\')" '+(item_type=='d_spirit_id'?'disabled':'')+'> <input type="button" value="稱號" onclick="parent.act_click(\'group\',\'depot_view\',\'d_title_id\')" '+(item_type=='d_title_id'?'disabled':'')+'> <input type="button" value="符咒" onclick="parent.act_click(\'group\',\'depot_view\',\'d_state_id\')" '+(item_type=='d_state_id'?'disabled':'')+'></td></tr>');
	f.write(temp_tebla2+temp_tebla1+'<br>');
	f.write('<tr bgcolor="#4B689E"><td>選擇</td><td>物攻</td><td>魔攻</td><td>物防</td><td>魔防</td><td>速度</td><td>運氣</td><td>能力限制</td><td>名稱</td></tr>');
	var num=0;
	if(a != "")
	{
		var s1=a.split(";");
		for(var i=0;i<s1.length;i++)
		{
			num++;
			var s2=s1[i].split(",");
			var temps=srhCount(s2[0]);
			var s3=null;
			if(tmpNum != "")
			{
				s3=tmpNum.split(",");
			}
			var mlv=s2[11]!="0"?"("+s2[11]+" LV)":"";
			for(var j=0;j<temps;j++)
			{
				var temp_num=s3!=null?"*"+s3[j]:"";
				f.write('<tr onMouseOver="this.style.backgroundColor=\'#0000CD\'" onMouseOut="this.style.backgroundColor=\'\'" onclick="parent.setRadioValue(\'adds\',\''+s2[0]+'\')" style="cursor:hand"><td><input type="radio" name="adds" value="'+s2[0]+'"></td><td>'+s2[1]+'</td><td>'+s2[2]+'</td><td>'+s2[3]+'</td><td>'+s2[4]+'</td><td>'+s2[5]+'</td><td>'+s2[10]+'</td><td>力:'+s2[6]+' 速:'+s2[7]+' 智:'+s2[8]+' '+mlv+'</td><td><a href="javascript:parent.foot_turn(\'arm\',\'check_item\','+s2[0]+')">'+s2[9]+'</a>'+temp_num+'</td></tr>');
			}
		}
	}else
	{
		f.write('<tr bgcolor="#2F4F4F"><td colspan="9" >公會倉庫沒有物品</td></tr>');
	}
	f.write('<tr><td colspan="9" > ');
	if(item_type=='d_item_id')
	{
		f.write('請選擇數量(1-99):<input type="text" name="item_num" size="2" maxlength="2" value="1"> , ');
	}else{
		f.write('請選擇數量(1-99):<input type="text" name="item_num" size="2" maxlength="2" value="1" disabled="disabled"> , ');
	}
	f.write('<input type="submit" value="取 出"> ('+num+'/'+a1+') | <input type="button" value="存取記錄" onClick=parent.act_click(\'group\',\'depot_msg\')></td></tr>');
	f.write('<tr><td colspan="9" class=b1><ol><li>倉庫上限：(公會等級+1) x 5</li><li>非道具或特殊類限制1次只能轉移1個</li><li>道具或特殊類每件物品最多放置99件</li></ol></td></tr>');
	f.write(temp_tebla2);
	f.write('<input type="hidden" name="f" value="group">');
	f.write('<input type="hidden" name="act" value="depot_move">');
	f.write('</form>');
	f.write('<span id="wog_message_box"></span>');
}
function group_depot_msg(msg)
{
	var f=parent.wog_view.document;
	message_cls();
	group_choose();
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write(temp_tebla1);
	f.write('<tr bgcolor="#4B689E"><td>內容</td><td>發生時間</td></tr>');
	if(msg!="")
	{
		var s1=msg.split(";");
		for(var i=0;i<s1.length;i++)
		{   
			var s2=s1[i].split(",");
			f.write('<tr><td>'+s2[0]+'</td><td>'+s2[1]+'</td></tr>');
		}
	}else
	{
		f.write('<tr><td colspan="2">尚未發生任何事件</td></tr>');   
	}
	f.write('<tr><td colspan="2"><input type="submit" value="清除所有訊息"></td></tr>');
	f.write(temp_tebla2);
	f.write('<input type="hidden" name="f" value="group">');
	f.write('<input type="hidden" name="act" value="depot_msg_clear">');
	f.write('</form>');
}
function group_class_view(skill,depot)
{
	var f=parent.wog_view.document;
	message_cls();
	group_choose();
	f.write('<form action="wog_act.php" method="post" target="mission" name="f1">');
	f.write(temp_tebla1);
	f.write('<tr><td colspan="2" bgcolor="#4B689E">公 會 階 級 設 定</td></tr>');
	f.write('<tr><td colspan="2" class=b1>階級說明：<li>１級限制為只有會長才能使用</li><li>２級限制為只有會長與副會長才能使用</li><li>３級限制為只有初階會員不能使用</li><li>不設限制為所有會員都能使用</li></td></tr>');
	f.write('<tr><td width="20%">技能限制：</td><td width="80%"><input type="radio" name="skill_set" value="0">不設　<input type="radio" name="skill_set" value="1">１級　<input type="radio" name="skill_set" value="2">２級　<input type="radio" name="skill_set" value="3">３級</td></td></tr>');
	f.write('<tr><td width="20%">倉庫限制：</td><td width="80%"><input type="radio" name="depot_set" value="0">不設　<input type="radio" name="depot_set" value="1">１級　<input type="radio" name="depot_set" value="2">２級　<input type="radio" name="depot_set" value="3">３級</td></td></tr>');
	f.write('<tr><td colspan="2"><input type="submit" value="設 定"></td></tr>');
	f.write(temp_tebla2);
	f.write('<input type="hidden" name="f" value="group">');
	f.write('<input type="hidden" name="act" value="class_set">');
	f.write('</form>');
	f.f1.skill_set[skill].checked=true; 
	f.f1.depot_set[depot].checked=true; 
}
function vip_view(s,lv,exp,money)
{
	message_cls();
	var f=parent.wog_view.document;
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write(temp_tebla1);
	if(s==0)
	{
		var yes="checked";
		var no="";
	}else
	{
		var yes="";
		var no="checked";	
	}
	f.write('<table width="50%" border="1" cellspacing="0" cellpadding="2" align="center" bordercolor="#4B689E">');
	f.write('<form action="wog_etc.php" target="mission">'); 
	f.write('<tr><td colspan="2" bgcolor="#4B689E">VIP信息 && 設定</td></tr>');
	f.write('<tr><td bgcolor="#4B689E">VIP等級：</td><td >'+lv+' 級</td></tr>');
	f.write('<tr><td bgcolor="#4B689E">戰鬥經驗加乘：</td><td >'+exp+' %</td></tr>');
	f.write('<tr><td bgcolor="#4B689E">戰鬥金錢加乘：</td><td >'+money+' %</td></tr>');
	f.write('<tr><td bgcolor="#4B689E">是否開啟加乘？</td><td ><input type="radio" name="vip_setup" value="0" '+yes+'>YES <input type="radio" name="vip_setup" value="1" '+no+'>NO </td></tr>');
	f.write('<tr><td colspan="2" ><input type="submit" value="確 定"></td></tr>');
	f.write(temp_tebla2);
	f.write('<input type="hidden" name="f" value="vip">');	
	f.write('<input type="hidden" name="act" value="setup">');
	f.write('</form>');
}
