/*===================================================== 
 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.
===================================================== */

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 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_table1); 
	f.write('<tr>'); 
	f.write('<td COLSPAn=15><center>幻想戰爭傑出玩家排行榜</center></td>'); 
	f.write('</tr><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_table2); 
	if(key != null) 
	{ 
 	var temp_str=""; 
	temp_str=well[key].temp_str; 
		if(temp_str) 
		{ 
			f.write('<center>');
			f.write('<table width="97%" border="2" cellspacing="2" cellpadding="5" align="center" bordercolor="#868686">'); 
			var s=temp_str.split(";"); 
			for(var j=0;j < s.length;j++) 
			{
				var s1=s[j].split(","); 
				f.write('<tr><td width="25%">No.'+s1[0]+'</td><td width="25%">'+s1[1]+'</td><td width="50%">'+s1[2]+'</td></tr>'); 
			} 
			f.write(temp_table2); 
			f.write('</center>'); 
		} 
	}
}
function get_temp_table1() {return temp_table1;}
function get_temp_table2() {return temp_table2;}
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('<LINK href=./wog.css rel=stylesheet type=text/css>');
   view.write('<body bgcolor="#000000" text="#EFEFEF" link="#EFEFEF" vlink="#EFEFEF" alink="#EFEFEF" style="Background-attachment:fixed; background-image: url(http://wog.we-u.net/img/chatbg.jpg); background-repeat:no-repeat;" >');
}
function chat_set_view() 
{ 
   var view=parent.wog_view.document; 
   message_cls(); 
   view.write(''); 
   view.write('<form name="frm">'); 
   view.write(temp_table1); 
   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="radio" name="fastcode_use" value="0">關閉 <input type="radio" name="fastcode_use" value="1" 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">關閉 <input type="radio" name="channel4" value="1" checked>開啟<br>'); 
   view.write('交易頻道 <input type="radio" name="channel5" value="0">關閉 <input type="radio" name="channel5" value="1" checked>開啟<br>'); 
   view.write('管理頻道 <input type="radio" name="channel6" value="0">關閉 <input type="radio" name="channel6" value="1" checked>開啟<br>'); 
   view.write('系統宣怖 <input type="radio" name="channel7" value="0">關閉 <input type="radio" name="channel7" value="1" checked>開啟<br>'); 
   view.write('<input type="hidden" name="channel8" value="1">'); 
   view.write('</td></tr>'); 
   view.write('<tr><td colspan="4"><input type="button" value="設定完成" onclick="parent.chat_set()" style="'+sbutton+'"></td></tr>'); 
   view.write(temp_table2); 
   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.fastcode_use[(chat_arr[1]=='0'?0:1)].checked=true; 
      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; 
   } 
} 
function chat_set() 
{ 
   var f=parent.wog_view.frm; 
   var chat_arr=[];
   chat_arr.push(0);
   chat_arr.push(f.fastcode_use[1].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('1');
   chat_arr=chat_arr.toString(','); 
   Sookie('wog_chat_cookie',chat_arr); 
   job_end(3); 
} 
var chat_timer="";
function window_open(a,b,c)
{
	if(a!="")
	{
		alert(a);
	}
	window.open(b,c);
}

function datechk(s,f)
{
	var thisfrom=parent.foot.document.f1;
	var error="";
	if(thisfrom.ats1.disabled==true)
	{
		error="15秒內不能冒險";
	}
	if(f.f_count.value > 200)
	{
		error="戰鬥回合數不能大於"+f_count;
	}
	if(f.a_type[0].checked==true)
	{
		thisfrom.act.value=f.act1.value;
		thisfrom.temp_id.value=0;
	}
	if(f.a_type[1].checked==true)
	{
		thisfrom.act.value=f.act2.value;
		thisfrom.temp_id.value=1;
		if(f.act2.value=="100")
		{
			if(!confirm("挑戰冠軍需付50000元費用"))
			{
				error="結束挑戰";
			}
		}
		if(f.act2.value=="101")
		{
			if(thisfrom.towho.value=="")
			{
				error="沒有選擇對像不能PK";
			}
		}
		
	}
	if(thisfrom.act.value=="")
	{
		error="請選擇場地";
	}
	if(error != "")
	{
		alert(error);
	}else
	{
		if(f.a_mode[0].checked==true)
		{
			thisfrom.temp_id2.value=1;
		}
		if(f.a_mode[1].checked==true)
		{
			thisfrom.temp_id2.value=2;
		}
		Sookie("wog_set_cookie", thisfrom.temp_id.value+","+thisfrom.act.value+","+thisfrom.temp_id2.value+","+f.act_area.value)
		Sookie("wog_set_f_count", f.f_count.value)
		Sookie("wog_set_f_hp", f.f_hp.value)
		thisfrom.f.value="fire";
		thisfrom.action="wog_fight.php";
		thisfrom.at_type.value=s;
		thisfrom.sat_name.value=f.sat_name.value;
		thisfrom.temp_id3.value=f.f_count.value;
		thisfrom.temp_id4.value=f.f_hp.value;
		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;
		}
}

//##### 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('td {font-family : verdana,Arial,Helvetica ;font-size : 10pt;	text-align : center;}');
	ff.write('.b1 {text-align : left;}');
	ff.write('</style>');
	ff.write('</head>');
	ff.write('<link rel="stylesheet" href="./wog.css" type="text/css">');
	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(http://wog.we-u.net/img/bg.jpg); background-repeat:no-repeat;" >');

}

//####### 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; 
   if(num==='') 
      num=0; 
   s.act1.selectedIndex=0; 
   var area=section.area[num]; 
   for(var i=0;i<area.place.length;i++){ 
      s.act1.options[i]=new Option(area.place[i].name,area.place[i].place_id); 
   } 
   s.act1.length=i; 
   s.act1.options[0].selected=true; 
}

function ad_view()
{
	var f=parent.wog_view.document;
	message_cls();
	f.write('<center><img src="./img/fire.gif"></center>');
	f.write(temp_table1);
	f.write('<form name=f1>');
	f.write('<tr><td><input type="radio" name="a_type" value="1" checked>冒險修行 <select name="act_area" onChange="parent.select_area(this.options[this.options.selectedIndex].value,this.form)"></select>');
	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" >武鬥競技 <select name="act2" onChange="parent.change_mission(1,this.form)"><option value="" SELECTED>選擇模式</option><option value="100" >挑戰冠軍</option></select></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="f_count" value="20" size="3" maxlength="3"> (最大'+f_count+')</td></tr>');
	f.write('<tr><td >HP低於 <input type="text" name="f_hp" value="15" size="3" maxlength="2"> %自動使用HP恢復劑</td></tr>');
	f.write('<tr><td ><input type="button" value="物理攻擊" onClick="parent.datechk(1,document.forms[0])" style="'+sbutton+'"> <input type="button" value="魔法攻擊" onClick="parent.datechk(2,document.forms[0])" style="'+sbutton+'"></td></tr>');
	f.write('<tr><td><input type="button" value="攻打領土" onClick="parent.act_click(\'group\',\'fire_list_peo\')" style="'+sbutton+'">--有加入公會才能使用</td></tr>');
	f.write('<tr><td>必殺技名稱 <input type="text" name="sat_name" size="40" maxlength="60" value="'+p_sat_name+'"></td></tr>');
	f.write('</form>');

f.write(temp_table2);


	var oForm=parent.wog_view.document.f1; 
	for(var i=0;i<section.area.length;i++){ 
		oForm.act_area.options[i]=new Option(section.area[i].name,i); 
	}
	var temp_s=Gookie("wog_set_cookie");
	if(temp_s!=null)
	{
		var s1=temp_s.split(",");
		if(s1[0]==0)
		{
			f.write('<script>document.forms[0].a_type[0].checked=true;document.forms[0].a_type[1].checked=false;parent.select_area("'+s1[3]+'",document.forms[0]);document.forms[0].act_area.value='+s1[3]+';document.forms[0].act1.value='+s1[1]+';</script>');
		}else
		{
			f.write('<script>document.forms[0].a_type[1].checked=true;document.forms[0].a_type[0].checked=false;document.forms[0].act2.value='+s1[1]+';</script>');
		}
		if(s1[2]==1)
		{
			f.write('<script>document.forms[0].a_mode[0].checked=true;document.forms[0].a_mode[1].checked=false;</script>');
		}else
		{
			f.write('<script>document.forms[0].a_mode[0].checked=true;document.forms[0].a_mode[1].checked=false;</script>');
//			view_name.document.write('<script>document.forms[0].a_mode[1].checked=true;document.forms[0].a_mode[0].checked=false;</script>');
		}
	}
	var temp_s=Gookie("wog_set_f_count");
	if(temp_s!=null)
	{
		f.write('<script>document.f1.f_count.value='+temp_s+';</script>');
	}
	var temp_s=Gookie("wog_set_f_hp");
	if(temp_s!=null)
	{
		f.write('<script>document.f1.f_hp.value='+temp_s+';</script>');
	}
}

function fire_date(p_at,p_df,p_mat,p_mdf,p_hp,p_hpmax,p_s,p_img_set,i_img,m_at,m_df,m_mat,m_mdf,m_hp,m_hpmax,m_s,m_name,m_img,f_status)
{
	var f=parent.wog_view.document;
	var p_name=get_name();
	var p_width=0,p_height=0,Pimg = new Image();
	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)*100;
	var temp_mhp_img=(temp_m_hp/temp_m_hpmax)*100;
	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";
		}		
		m_img='<img id=g2 src="'+m_img+'" border="0" style="position: absolute;left: 65%;top: 200;Z-INDEX: 1;visibility: visible">';
	}else
	{
		m_img=mimg+m_img;
		m_img='<img id=g2 src="'+m_img+'" border="0" style="position: absolute;left: 65%;top: 150;Z-INDEX: 1;visibility: visible">';
	}
	if(p_img_set==1)
	{
		p_img=i_img;
	}else
	{
		p_img=img+i_img+".gif";
	}
	Pimg.src=p_img; 
	p_height=200-Math.floor(parseInt(Pimg.height)/4) 
	f.write(fight_temp_table1+'<tr><td colspan="4">'+p_name+' ('+p_s+'屬性)</td><td width="100" rowspan="7">第 <font color="red" size="4"><span id="count">0</span></font> 回合</td><td colspan="4" >'+m_name+' ('+m_s+'屬性)</td></tr>'); 
	f.write('<tr><td width="12.5%">HP</td><td class=b1 width="37.5%" colspan="3"><img src='+img+'bar/bhg.gif border="0" width="'+temp_php_img+'%" id="p_img" height="9" alt=""></td><td width="12.5%">HP</td><td class=b1 width="37.5%" colspan="3"><img src='+img+'bar/bhg.gif border="0" width="100%" id="m_img" height="9" alt=""></td></tr>'); 
	f.write('<tr><td>物攻</td><td width="12.5%">'+p_at+'</td><td width="12.5%">物防</td><td width="12.5%">'+p_df+'</td><td width="12.5%">物攻</td><td width="12.5%">'+m_at+'</td><td width="12.5%">物防</td><td width="12.5%">'+m_df+'</td></tr>');  
	f.write('<tr><td width="12.5%">魔攻</td><td width="12.5%">'+p_mat+'</td><td>魔防</td><td width="12.5%">'+p_mdf+'</td><td width="12.5%">魔攻</td><td width="12.5%">'+m_mat+'</td><td>魔防</td><td width="12.5%">'+m_mdf+'</td></tr>');     
	f.write(temp_table2);
	f.write('<table width="600" border="0" cellspacing="0" cellpadding="0" align="center" >');
	f.write('<tr><td width="50%" height="185" align="center"><img id=g1 src="'+p_img+'" border="0" style="position: absolute;left: 15%;top: '+p_height+';Z-INDEX: 1;visibility: visible"></td><td align="center" width="50%" height="150">'+m_img+'</td></tr>');
//	f.write('<tr><td colspan="2" align="center">'+hr+'<div align="center" id="a1"></td></tr>');
	f.write(temp_table2);
	f.write('<br><table width="97%" border="0" cellspacing="0" cellpadding="0" align="center" ><tr><td colspan="2" align="center">'+hr+'<div align="center" id="a1"></td></tr>');
	f.write(temp_table2);
	f.write('<img id=g3 border="0" style="position: absolute;left: 5%;top: 150;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: 5%;top: 200;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()",700);
	}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=(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;
	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;
	f.getElementById("p_img").width=temp_php_img;
	f.getElementById("p_img").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)
{	
	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(temp_table1+'<tr><td colspan="3"><b>'+s+' '+enstr+'</b></td></tr>');
	f.write('<tr><td class="b1"><b>HP剩下 '+p_hp+'</b></td>');
	f.write('<td class="b1"><b>獲得經驗值 '+getexp+'</b></td>');
	f.write('<td class="b1"><b>獲得金錢 '+getmoney+'</b></td></tr>');
	f.write(temp_table2);
}

function get_item(i,s,bag)
{	
	var f=parent.wog_view.document;
	var enstr="";
	if(s==0)
	{
		enstr="裝備欄超過"+bag+"樣物品無法裝入";
	}else if(s==1)
	{
		enstr="幸運撿到";
		parent.wog_log_save('取得寶物'+i);
	}
	f.write(hr);
	f.write(temp_table1+'<tr><td ><b>'+enstr+' '+i+'</b></td></tr>');
	f.write(temp_table2);
}

function get_sppt()
{	
	var f=parent.wog_view.document;
	f.write(hr);
	f.write(temp_table1+'<tr><td ><b>幻想點數增加了1</b></td></tr>');
	f.write(temp_table2);
}

function god_leave(pt,sppt)
{	
	var f=parent.wog_view.document;
	f.write(hr);
	f.write(temp_table1+'<tr><td ><b>守護者離開了,留下了 '+pt+' 霧靈鬼魂和 '+sppt+' 幻想點數給你!</b></td></tr>');
	f.write(temp_table2);
}

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(temp_table1+'<tr><td ><b>'+p_name+' 使用 '+s+'</b></td></tr>');
	f.write(temp_table2);
}
function lv_up(str,agl,smart,life,vit,au,be,up_type)
{
	var f=parent.wog_view.document;
	if(up_type==null)
	{
		f.write(hr);
		f.write(temp_table1);
		f.write('<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></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></tr>');
		f.write(temp_table2);
	}
}
function lv_up2(str,agl,smart,life,vit,au,be,p_exp,time)
{
	var f=parent.wog_view.document;
	if(p_exp!=null)
	{
		message_cls();
		f.write(temp_table1+'<tr><td class="b1" 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>');
	if(p_exp!=null)
	{
		f.write('<td><b>EXP</b></td>');
	}
	f.write('</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>'+time+'場</b></td>');
	if(p_exp!=null)
	{
		f.write('<td><b>↑ '+p_exp+'</b></td>');
	}
	f.write('</tr>');
	f.write(temp_table2);
}
function bag_up(str)
{
	var f=parent.wog_view.document;
	message_cls();
	f.write(temp_table1+'<tr><td class="b1"><b>道具欄增加 '+str+' 格</b></td></tr>');
	f.write(temp_table2);
}
function cont_fight(lv,p_id,win,s)
{	
	var f=parent.wog_view.document;
	f.write(hr);
	f.write(temp_table1);
	f.write('<form action="wog_fight.php" method="post" target="mission">');
	f.write('<tr><td>挑戰等級 LV'+lv+' <input type="submit" value="挑戰下一位">(對戰間隔時間3秒鐘)</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_table2);
}

function cp_end(p_name)
{
	var f=parent.wog_view.document;
	f.write(temp_table1);
	f.write('<tr><td  >'+p_name+' 順利當上冠軍 </td></tr>')
	f.write(temp_table2);
}

//##### 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('<center><img src="./img/shop.gif"></center>');
	f.write(temp_table1);
	f.write('<tr><td><img src=img/shop/weapon.gif><br>裝備商店</td><td>');
f.write('<input type="button" value="裝備商店" onClick="parent.th_submit(document.f1,1,0)" style="'+sbutton+'">');
f.write('<input type="button" value="道具小店" onClick="parent.th_submit(document.f1,1,\'5,6\')" style="'+sbutton+'">');
f.write('<input type="button" value="座騎商店" onClick="parent.th_submit(document.f1,1,8)" style="'+sbutton+'">');
f.write('<input type="button" value="幻想書局" onClick="parent.th_submit(document.f1,1,10)" style="'+sbutton+'">');
f.write('<input type="button" value="裝備雜貨屋" onClick="parent.th_submit(document.f1,8,0)" style="'+sbutton+'">');
f.write('<input type="button" value="藏寶洞" onClick="parent.th_submit(document.f1,9,6)" style="'+sbutton+'">');
f.write('<input type="button" value="印花屋" onClick="parent.stamp()" style="'+sbutton+'">');
	f.write('</td></tr>');
	f.write('<tr><td><img src=img/shop/other.gif><br>服務中心</td><td>');
f.write('<input type="button" value="職業中心" onClick="parent.act_click(\'job\',\'view\')" style="'+sbutton+'">');
f.write('<input type="button" value="勇者部屋" onClick=parent.act_click("ch","ch_ch_confirm") style="'+sbutton+'">');
f.write('<input type="button" value="復活中心" onClick=if(confirm("使用復活中心會把經驗值變零及需等候15秒才能冒險，確定是否復活")){parent.act_click(\'chara\',\'revive\')} style="'+sbutton+'">');
f.write('<input type="button" value="幻寵樂園" onClick="parent.act_click(\'pet\',\'index\')" style="'+sbutton+'">');
f.write('<input type="button" value="變臉中心" onClick=parent.black_shop() style="'+sbutton+'">');
f.write('<input type="button" value="幻想郵局" onClick=parent.act_click("message","message_click") style="'+sbutton+'">');
f.write('<input type="button" value="銀行中心" onClick=parent.act_click("bank","view") style="'+sbutton+'">');
	f.write('</td></tr>');
	f.write('<tr><td><img src=img/shop/other.gif><br>幻戰設施</td><td>');
f.write('<input type="button" value="拍賣會叫價區" onClick="parent.act_click(\'rbid\',\'view\')" style="'+sbutton+'">');
f.write('<input type="button" value="官職大殿" onClick="parent.ch_grade()" style="'+sbutton+'">');
f.write('<input type="button" value="聊天頭銜" onClick="parent.ch_chat()" style="'+sbutton+'">');
f.write('<input type="button" value="合成大師" onClick="parent.act_click(\'syn\',\'list\')" style="'+sbutton+'">');
f.write('<input type="button" value="命運之泉" onClick=parent.act_click("ch","ch_luck_confirm") style="'+sbutton+'">');
f.write('<input type="button" value="勇士再生" onClick=parent.act_click("rebirth","rebirth_confirm") style="'+sbutton+'">');
f.write('<input type="button" value="幻想迷宮" onClick=parent.act_click(\'mission\',\'7\') style="'+sbutton+'">');
	f.write('</td></tr>');
	f.write(temp_table2);
	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,price)
{
	message_cls();
	var f=parent.wog_view.document;
	f.write(temp_table1);
	f.write('<form action="wog_act.php" method="post" name="f1" target="mission">');
	if(temp_id2<=7 && temp_id<6){
	f.write('<tr><td colspan=6>第'+temp_id2+'級裝備</td></tr>');
	f.write('<tr>');
	f.write('<td '+(temp_id=='0'?'bgcolor="#4B689E"':'onmouseover="this.style.color=\'#4B689E\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,'+temp_id2+',0)"')+'>武器裝備</td>');
	f.write('<td '+(temp_id=='1'?'bgcolor="#4B689E"':'onmouseover="this.style.color=\'#4B689E\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,'+temp_id2+',1)"')+'>頭部裝備</td>');
	f.write('<td '+(temp_id=='2'?'bgcolor="#4B689E"':'onmouseover="this.style.color=\'#4B689E\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,'+temp_id2+',2)"')+'>身體裝備</td>');
	f.write('<td '+(temp_id=='3'?'bgcolor="#4B689E"':'onmouseover="this.style.color=\'#4B689E\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,'+temp_id2+',3)"')+'>手部裝備</td>');
	f.write('<td '+(temp_id=='4'?'bgcolor="#4B689E"':'onmouseover="this.style.color=\'#4B689E\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,'+temp_id2+',4)"')+'>腳部裝備</td>');
	f.write('</tr>');
	f.write(temp_table2);
	f.write(temp_table1);
	f.write('<tr>');
	f.write('<td '+(temp_id2=='1'?'bgcolor="#4B689E"':'onmouseover="this.style.color=\'#4B689E\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,1,'+temp_id+')"')+'>LV1</td>');
	f.write('<td '+(temp_id2=='2'?'bgcolor="#4B689E"':'onmouseover="this.style.color=\'#4B689E\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,2,'+temp_id+')"')+'>LV2</td>');
	f.write('<td '+(temp_id2=='3'?'bgcolor="#4B689E"':'onmouseover="this.style.color=\'#4B689E\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,3,'+temp_id+')"')+'>LV3</td>');
	f.write('<td '+(temp_id2=='4'?'bgcolor="#4B689E"':'onmouseover="this.style.color=\'#4B689E\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,4,'+temp_id+')"')+'>LV4</td>');
	f.write('<td '+(temp_id2=='5'?'bgcolor="#4B689E"':'onmouseover="this.style.color=\'#4B689E\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,5,'+temp_id+')"')+'>LV5</td>');
	f.write('<td '+(temp_id2=='6'?'bgcolor="#4B689E"':'onmouseover="this.style.color=\'#4B689E\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,6,'+temp_id+')"')+'>LV6</td>');
	f.write('<td '+(temp_id2=='7'?'bgcolor="#4B689E"':'onmouseover="this.style.color=\'#4B689E\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,7,'+temp_id+')"')+'>LV7</td>');
	}
	if(temp_id2==8){
	f.write('<tr><td colspan=10>裝備雜貨屋</td></tr>');
	f.write('<tr>');
	f.write('<td '+(temp_id=='0'?'bgcolor="#4B689E"':'onmouseover="this.style.color=\'#4B689E\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,'+temp_id2+',0)"')+'>武器裝備</td>');
	f.write('<td '+(temp_id=='1'?'bgcolor="#4B689E"':'onmouseover="this.style.color=\'#4B689E\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,'+temp_id2+',1)"')+'>頭部裝備</td>');
	f.write('<td '+(temp_id=='2'?'bgcolor="#4B689E"':'onmouseover="this.style.color=\'#4B689E\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,'+temp_id2+',2)"')+'>身體裝備</td>');
	f.write('<td '+(temp_id=='3'?'bgcolor="#4B689E"':'onmouseover="this.style.color=\'#4B689E\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,'+temp_id2+',3)"')+'>手部裝備</td>');
	f.write('<td '+(temp_id=='4'?'bgcolor="#4B689E"':'onmouseover="this.style.color=\'#4B689E\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,'+temp_id2+',4)"')+'>腳部裝備</td>');
	f.write('<td '+(temp_id=='5,6'?'bgcolor="#4B689E"':'onmouseover="this.style.color=\'#4B689E\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,'+temp_id2+',\'5,6\')"')+'>道具裝備</td>');
	f.write('<td '+(temp_id=='7'?'bgcolor="#4B689E"':'onmouseover="this.style.color=\'#4B689E\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,'+temp_id2+',7)"')+'>護符裝備</td>');
	f.write('<td '+(temp_id=='8'?'bgcolor="#4B689E"':'onmouseover="this.style.color=\'#4B689E\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,'+temp_id2+',8)"')+'>座騎裝備</td>');
	f.write('<td '+(temp_id=='9'?'bgcolor="#4B689E"':'onmouseover="this.style.color=\'#4B689E\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,'+temp_id2+',9)"')+'>幻想卡裝備</td>');
	}
	if(temp_id==8 && temp_id2<4){
	f.write('<tr><td colspan=10>座騎裝備</td></tr>');
	f.write('<tr>');
	f.write('<td '+(temp_id2=='1'?'bgcolor="#4B689E"':'onmouseover="this.style.color=\'#4B689E\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,1,8)"')+'>物理座騎</td>');
	f.write('<td '+(temp_id2=='2'?'bgcolor="#4B689E"':'onmouseover="this.style.color=\'#4B689E\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,2,8)"')+'>魔法座騎</td>');
	f.write('<td '+(temp_id2=='3'?'bgcolor="#4B689E"':'onmouseover="this.style.color=\'#4B689E\'" onmouseout="this.style.color=\'white\'" onclick="parent.th_submit(document.f1,3,8)"')+'>神之座騎</td>');
	}
	if(temp_id2==9){
	f.write('<tr><td colspan=10>藏寶洞</td>');
	}
	if(temp_id=="5,6" && temp_id2==1){
	f.write('<tr><td colspan=10>道具小店</td>');
	}
	if(temp_id==10 && temp_id2==1){
	f.write('<tr><td colspan=10>幻想書局</td>');
	}
	f.write('</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_table2);
	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('<form action="wog_act.php" method="post" target="mission">');
	f.write(temp_table1);
if(price<1)
{
	f.write('<tr><td colspan=12>現時物價:<font color=blue><b>'+price+'</b></font></td></tr>');
}
if(price>1)
{
	f.write('<tr><td colspan=12>現時物價:<font color=red><b>'+price+'</b></font></td></tr>');
}
if(price==1)
{
	f.write('<tr><td colspan=12>現時物價:'+price+'</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><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[11]==0){
			s10="無";
			}else{
			s10="'+s2[11]+' 熟練度:('+job_pro(s2[12])+'%)";
			}
			f.write('<tr onMouseOver="this.style.backgroundColor=\'#777779\'" onMouseOut="this.style.backgroundColor=\'\'" onclick="parent.wog_view.document.forms[2].adds['+i+'].checked=true" 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>'+s10+'</td><td>力:'+s2[8]+' 速:'+s2[9]+' 智:'+s2[10]+' 轉生:'+s2[14]+'</td><td>'+s2[5]+'</td><td>'+s2[4]+'</td><td>'+s2[13]+'</td><td>'+s2[15]+'</td></tr>');
		}
	}else
	{
		f.write('<tr><td colspan="13" >沒有可以使用的裝具</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>---</td><td>---</td><td>'+s1[3]+'</td><td>---</td><td>---</td><td>---</td></tr>');
	f.write('<tr><td colspan="14">請選擇數量:<input type="text" name="buy_num" value="1" size="2" maxlength="2"> (最大30)');
	f.write('<tr><td colspan="13" ><input type="submit" value="確定購買" style="'+sbutton+'">購買時將扣除價錢*物價的金錢</td></tr>');
	f.write('<tr><td colspan="13" >身上金額 '+s1[6]+'</td></tr>');
	f.write(temp_table2);
	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>');
}

function black_shop()
{
	message_cls();
	var f=parent.wog_view.document;
	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(temp_table1);
	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="使用系統圖像" style="'+sbutton+'"></td></tr>');
	f.write('<tr><td>變臉手術需花30萬</td></tr>');
	f.write(temp_table2);
	f.write('</form>');
	f.write('<p>');
	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(temp_table1);
	f.write('<tr><td>輸入圖像連結 <input type="text" name="url" value="http://" size="45" maxlength="150"> </td></tr>');
	f.write('<tr><td>(最佳size請勿超過 120*120)</td></tr>');
	f.write('<tr><td><input type="submit" value="使用自訂圖像" style="'+sbutton+'"></td></tr>');
	f.write('<tr><td>變臉手術需花30萬</td></tr>');
	f.write(temp_table2);
	f.write('</form>');
/*
	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(temp_table1);
	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="改變性別"></td></tr>');
	f.write('<tr><td>變性手術需花100萬</td></tr>');
	f.write(temp_table2);
	f.write('</form>');
*/
}

function sale_item(s,pay_id)
{
	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(temp_table1);
	f.write('<tr><td colspan="3">幻想二手市場</td></tr>');
	f.write('<tr><td colspan="3">擺攤時間單位為天數,時間到期自動下架</td></tr>');
	f.write('<tr><td>'+s1[1]+'</td><td>價格 <input type="text" name="money" size="20" maxlength="20">元</td><td>擺攤時間 <input type="text" name="day" size="2" maxlength="2">天 </td></tr>');
	f.write('<tr><td colspan="3">指定買家(沒有請留空) <input type="text" name="pay_id" size="20"></td></tr>');
	f.write('<tr><td colspan="3">確認安全密碼 <input type="password" name="pw" size="20"></td></tr>');
	f.write('<tr><td colspan="3"><input type="button" value="開始擺攤" style="'+sbutton+'" onclick="parent.data_send2(\'sale\',\'sale\',document.f1.item_id.value,document.f1.money.value,document.f1.day.value,document.f1.pay_id.value,document.f1.pw.value)"></td></tr>');
	f.write('<tr><td colspan="3">擺攤時間不能超過15天,一人擺攤的商品不能超過5種</td></tr>');
	f.write(temp_table2);
	f.write('</form>');
}

function sale_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="view">');
	f.write('</form>');
	f.write('<form action="wog_act.php" method="post" target="mission" name=f1>');
	f.write(temp_table1);
	f.write('<tr><td colspan="15"><a href=javascript:parent.sel_type("0");>武器</a> <a href=javascript:parent.sel_type("1");>頭部</a>  <a href=javascript:parent.sel_type("2");>身體</a> <a href=javascript:parent.sel_type("3");>手套</a> <a href=javascript:parent.sel_type("4");>鞋子</a> <a href=javascript:parent.sel_type("5");>道具</a> <a href=javascript:parent.sel_type("7");>護符</a> <a href=javascript:parent.sel_type("8");>座騎</a> <a href=javascript:parent.sel_type("9");>幻想卡</a> <a href=javascript:parent.sel_type("10");>幻戰書</a> <a href=javascript:parent.sel_type("11");>守護者</a> <a href=javascript:parent.sel_type("12");>寵物</a></td></tr>');
	f.write('<tr><td colspan="15">幻想二手市場</td></tr>');
	if(type < 12)
	{	
		f.write('<tr><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 now_date=new Date();
				var sale_day=Math.ceil((s2[13]-(now_date.getTime()/1000))/(60*60*24));
				f.write('<tr onMouseOver="this.style.backgroundColor=\'#777779\'" onMouseOut="this.style.backgroundColor=\'\'" onclick="parent.setRadioValue(\'s_id\','+s2[11]+');" style="cursor:hand"><td><input type="radio" name="s_id" value="'+s2[11]+'"></td><td>'+s2[0]+'</td><td>'+s2[15]+'</td><td><span onmouseover="parent.board_view(event,\''+s2+'\')" onmouseout="parent.board_close()">'+s2[1]+'</span></td><td>'+s2[12]+'</td><td>'+s2[10]+'</td><td>'+sale_day+'</td></tr>');
			}
		}
		f.write('<input type="hidden" name="stype" value="0">');
	}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();
				var sale_day=Math.ceil((s2[11]-(now_date.getTime()/1000))/(60*60*24));
				f.write('<tr><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>'+sale_day+'</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="15"><input type="submit" value="購買" style="'+sbutton+'"></td></tr>');
	f.write(temp_table2);
	f.write('<input type="hidden" name="f" value="sale">');
	f.write('<input type="hidden" name="act" value="buy">');
	f.write('</form>');
	f.write('<div id="itemview" name="itemview" style="display:none;background:black;border:1px solid #4B689E;width:160px;height:100px;position:absolute;left:0px;top:0px"></div>');
}

//###### 分頁 begin #####
function pagesplit(saletotal,page)
{
	var view_name=parent.wog_view;
	view_name.document.write(temp_table1);
	view_name.document.write('<tr><td>');
	var totalpage=0;
	if(saletotal%8==0)
	{
		totalpage=saletotal/8;
	}else
	{
		totalpage=(saletotal/8)+1;
	}
	for(var i=1;i<=totalpage;i++)
	{
		if(i==page)
		{
			view_name.document.write(' '+i+' ');
		}else
		{
			view_name.document.write(' <a href=javascript:parent.page_jump("'+i+'")>'+i+'</a> ');
		}
	}
	view_name.document.write('</td></tr>');
	view_name.document.write(temp_table2);
}
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_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,card_name,car_name,ca_name,book_name,god_name,p_url,p_homename,s_ch_name,p_sat_name,p_place,p_birth,p_cdate,bbsid,p_rebirth,p_grade,p_pt,p_sppt,p_luck,p_status,p_exp_time,p_exp_multi,suit_namea,p_stamp)
{
	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;
	d_a_name=a_name;
	d_body_name=body_name;
	d_head_name=head_name;
	d_hand_name=hand_name;
	d_foot_name=foot_name;
	d_item_name=item_name;
	d_card_name=card_name;
	d_car_name=car_name;
	d_ca_name=ca_name;
	d_book_name=book_name;
	d_god_name=god_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_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_grade,p_pt,p_sppt,p_luck,p_status,p_exp_time,p_exp_multi,suit_namea,p_stamp);
	foot_fire();
}
function show_status(p_win,p_lost,p_img_set,i_img,p_sex,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,p_place,p_rebirth,p_grade,p_pt,p_sppt,p_luck,p_status,p_exp_time,p_exp_multi,suit_namea,p_stamp)
{
	message_cls();
	status_view(p_win,p_lost,p_img_set,i_img,p_sex,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,p_place,p_rebirth,p_grade,p_pt,p_sppt,p_luck,p_status,p_exp_time,p_exp_multi,suit_namea,p_stamp);
}
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,x_name,y_name,z_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,p_grade,p_pt,p_sppt,p_luck,book_name,god_name)
{
	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/well2.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_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,x_name,y_name,z_name,book_name,god_name,p_place,p_birth,p_cdate,p_url,p_homename,s_ch_name,win_num,a_win,p_rebirth,p_grade,p_pt,p_sppt,p_luck,p_status,g_name,g_s_name,suit_namea)
{
	var cp_name=parent.wog_view;
	message_cls();
	status_view2(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,x_name,y_name,z_name,book_name,god_name,p_place,p_birth,p_cdate,p_url,p_homename,s_ch_name,win_num,p_rebirth,p_grade,p_pt,p_sppt,p_luck,p_status,g_name,g_s_name,suit_namea);
}

function a_view(a_win)
{
	var view_name=parent.wog_view;
	view_name.document.write('<tr><td width="100%" colspan="2" valign="top">比武大會前三名</td></tr>');
	view_name.document.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);
	view_name.document.write(temp_s+'</td></tr>');
}

function status_view(p_win,p_lost,p_img_set,i_img,p_sex,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,p_place,p_rebirth,p_grade,p_pt,p_sppt,p_luck,p_status,p_exp_time,p_exp_multi,suit_namea,p_stamp)
{
	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";
	}
	var sex="";
	(p_sex=="1")?sex="男":sex="女";
	p_s=s_status(p_s);
	var user_prestige
	var p_strf=get_f(p_str,50000);
	var user_prestige
	var p_smartf=get_f(p_smart,50000);
	var p_aglf=get_f(p_agl,50000);
	var p_lifef=get_f(p_life,50000);
	var p_auf=get_f(p_au,50000);
	var p_bef=get_f(p_be,50000);
	var p_vitf=get_f(p_vit,50000);
	var p_atf=get_f(p_at,50000);
	var p_matf=get_f(p_mat,50000);
	var p_dff=get_f(p_df,50000);
	var p_mdff=get_f(p_mdf,50000);
//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;
	var exp_img1=""; 
	var exp_img2=""; 
	var hp_img1=""; 
	var hp_img2=""; 
	if(p_expf >= 1)
	{
	exp_img1='<img src="'+img+'bar/bxg.gif" width="'+p_expf+'%" height="9" title="'+p_expf+'%">';
	} 
	if(p_nextexpf >= 1)
	{
	exp_img2='<img src="'+img+'bar/bhg.gif" width="'+p_nextexpf+'%" height="9" title="'+p_expf+'%">';
	} 
	if(p_hpf >= 1)
	{
	hp_img1='<img src="'+img+'bar/bxg.gif" width="'+p_hpf+'%" height="9" title="'+p_hpf+'%">';
	} 
	if(p_hpmaxf >= 1)
	{
	hp_img2='<img src="'+img+'bar/bhg.gif" width="'+p_hpmaxf+'%" height="9" title="'+p_hpf+'%">';
	} 
//EXP&HPbar_End 

f.write('<center><img src="./img/stat.gif"></center>');
f.write(temp_table1);
f.write('<tr><td width="60%">');
f.write(temp_table1);
f.write('<tr><td colspan="2">勝場 '+p_win+' / 敗場 '+p_lost+'　(獲勝率:'+Math.floor((p_win/(p_win+p_lost))*100)+'%)</td></tr>');
f.write('<tr><td colspan="2"><img src="'+p_img+'" border="0" ></td></tr>');
f.write('<tr><td bgcolor="#000099">金錢</td><td><b>'+p_money+'</b></td></tr>');
f.write('<tr><td bgcolor="#000099">霧靈鬼魂</td><td><b>'+p_pt+'</b></td></tr>');
f.write('<tr><td bgcolor="#000099">幻想點數</td><td><b>'+p_sppt+'</b></td></tr>');
f.write('<tr><td bgcolor="#000099">印花數目</td><td><b>'+p_stamp+'</b></td></tr>');
f.write('<tr><td bgcolor="#996600">冒險地</td><td><b>'+section.getPlace(p_place)+'</b></td></tr>');
if(p_exp_time != 0){
f.write('<tr><td bgcolor="#996600">經驗加乘</td><td><b>還有'+p_exp_time+'場'+p_exp_multi+'倍經驗</b></td></tr>');
}else{
f.write('<tr><td bgcolor="#996600">經驗加乘</td><td><b>沒有</b></td></tr>');
}
f.write('<tr><td bgcolor="#990099">出生地</td><td><b>'+my_birth+'</b></td></tr>');
f.write('<tr><td>Exp</td><td>'+exp_img1+exp_img2+'<b>'+Math.floor((p_exp/p_nextexp)*100)+'%</b></td></tr>');
f.write('<tr><td>HP</td><td>'+hp_img1+hp_img2+'<b>'+p_hp+'/'+p_hpmax+'</b></td></tr>');
f.write('</table></td><td width="40%">');
f.write(temp_table1);
f.write('<tr><td bgcolor="#006600">勇者姓名</td><td><b>'+p_name+' ('+sex+''+my_age+'歲)</b></td></tr>');
f.write('<tr><td bgcolor="#006600">等級</td><td><b>'+p_rebirth+' 轉 '+p_lv+' 級</b></td></tr>');
f.write('<tr><td bgcolor="#006600">職業</td><td><b>'+p_s+'屬 '+d_ch_name+'</b></td></tr>');
if(p_grade != ''){
f.write('<tr><td bgcolor="#006600">官職</td><td ><b>'+p_grade+'</b></td></tr>');
}else{
f.write('<tr><td bgcolor="#006600">官職</td><td ><b>平民</b></td></tr>');
}
if(d_s_ch_name != ''){
f.write('<tr><td bgcolor="#006600">奧義</td><td ><b>'+d_s_ch_name+'奧義</b></td></tr>');
}else{
f.write('<tr><td bgcolor="#006600">奧義</td><td ><b>未有裝備奧義</b></td></tr>');
}
if(p_group != ''){
f.write('<tr><td bgcolor="#E6C075">所屬公會</td><td><b>'+p_group+'</b></td></tr>');
}else{
f.write('<tr><td bgcolor="#E6C075">所屬公會</td><td><b>未有所屬公會</b></td></tr>');
}
if(p_style != ''){
f.write('<tr><td bgcolor="#E6C075">公會頭銜</td><td><b>'+p_style+'</b></td></tr>');
}else{
f.write('<tr><td bgcolor="#E6C075">公會頭銜</td><td><b>未有公會頭銜</b></td></tr>');
}
f.write('<tr><td bgcolor="#3300FF">守護者</td><td><b><span onmouseover="parent.textboard_view('+desc_id[11]+',event)" onmouseout="parent.textboard_close()">'+d_god_name+'</span></b></td>');
f.write('</table>');
f.write('</hr>');
f.write('<table border=0 width=300>');
f.write('<tr><td><fieldset style="height:100; width:300;"><legend>個人狀態及廣告區</legend><b>'+p_status+'</b></fieldset></td></tr>');
f.write('</table>');
f.write('</td></tr></table>');
f.write('<hr>');
f.write(temp_table1);
f.write('<tr><td colspan="8" bgcolor="#555555"><b>角色能力</b></td></tr>');
f.write('<tr><td bgcolor="#555555">力量</td><td class="b"><b>'+p_str+'</b></td>');
f.write('<td bgcolor="#555555">敏捷</td><td class="b"><b>'+p_agl+'</b></td>');
f.write('<td bgcolor="#555555">魅力</td><td class="b"><b>'+p_au+'</b></td>');
f.write('<td bgcolor="#555555">體質</td><td class="b"><b>'+p_vit+'</b></td></tr>');
f.write('<tr><td bgcolor="#555555">智力</td><td class="b"><b>'+p_smart+'</b></td>');
f.write('<td bgcolor="#555555">生命</td><td class="b"><b>'+p_life+'</b></td>');
f.write('<td bgcolor="#555555">信仰</td><td class="b"><b>'+p_be+'</b></td>');
f.write('<td bgcolor="#555555">運氣</td><td class="b"><b>'+p_luck+'</b></td></tr>');
f.write('</table>');
f.write('<hr>');
f.write(temp_table1);
f.write('<tr><td colspan="4" bgcolor="#555555"><b>角色數值</b></td></tr>');
f.write('<tr><td width="10%" bgcolor="#555555">物攻</td><td class="b1" width="40%"><img src="'+img+'bar/bmg.gif" width="'+p_atf+'%" height="9"><b>'+p_at+'</b></td></tr>')
f.write('<tr><td width="10%" bgcolor="#555555">物防</td><td class="b1" width="40%"><img src="'+img+'bar/bmg.gif" width="'+p_dff+'%" height="9"><b>'+p_df+'</b></td></tr>')
f.write('<tr><td width="10%" bgcolor="#555555">魔攻</td><td class="b1" width="40%"><img src="'+img+'bar/bmg.gif" width="'+p_matf+'%" height="9"><b>'+p_mat+'</b></td></tr>')
f.write('<tr><td width="10%" bgcolor="#555555">魔防</td><td class="b1" width="40%"><img src="'+img+'bar/bmg.gif" width="'+p_mdff+'%" height="9"><b>'+p_mdf+'</b></td></tr>')
f.write('</tr></table>');
f.write('<hr>');
f.write(temp_table1);
f.write('<tr><td colspan="5" bgcolor="#555555"><b>角色裝備 【 '+suit_namea+' 】</b></td></tr>');
f.write('<tr>');
f.write('<td>武器<br><img src="./img/eq/weapon2.gif"><br><b><span onmouseover="parent.textboard_view('+desc_id[0]+',event)" onmouseout="parent.textboard_close()">'+d_a_name+'</span></b></td>');
f.write('<td>頭部<br><img src="./img/eq/head2.gif"><br><b><span onmouseover="parent.textboard_view('+desc_id[1]+',event)" onmouseout="parent.textboard_close()">'+d_head_name+'</span></b></td>');
f.write('<td>身體<br><img src="./img/eq/body2.gif"><br><b><span onmouseover="parent.textboard_view('+desc_id[2]+',event)" onmouseout="parent.textboard_close()">'+d_body_name+'</span></b></td>');
f.write('<td>手部<br><img src="./img/eq/hand2.gif"><br><b><span onmouseover="parent.textboard_view('+desc_id[3]+',event)" onmouseout="parent.textboard_close()">'+d_hand_name+'</span></b></td>');
f.write('<td>腳部<br><img src="./img/eq/foot2.gif"><br><b><span onmouseover="parent.textboard_view('+desc_id[4]+',event)" onmouseout="parent.textboard_close()">'+d_foot_name+'</span></b></td>');
f.write('</tr><tr>');
f.write('<td>道具<br><img src="./img/eq/item2.gif"><br><b><span onmouseover="parent.textboard_view('+desc_id[5]+',event)" onmouseout="parent.textboard_close()">'+d_item_name+'</span></b></td>');
f.write('<td>座騎<br><img src="./img/eq/car2.gif"><br><b><span onmouseover="parent.textboard_view('+desc_id[8]+',event)" onmouseout="parent.textboard_close()">'+d_car_name+'</span></b></td>');
f.write('<td>護符<br><img src="./img/eq/card2.gif"><br><b><span onmouseover="parent.textboard_view('+desc_id[7]+',event)" onmouseout="parent.textboard_close()">'+d_card_name+'</span></b></td>');
f.write('<td>幻想卡<br><img src="./img/eq/ca2.gif"><br><b><span onmouseover="parent.textboard_view('+desc_id[9]+',event)" onmouseout="parent.textboard_close()">'+d_ca_name+'</span></b></td>');
f.write('<td>幻戰書<br><img src="./img/eq/book2.gif"><br><b><span onmouseover="parent.textboard_view('+desc_id[10]+',event)" onmouseout="parent.textboard_close()">'+d_book_name+'</span></b></td>');
f.write('</tr></table>');
f.write(temp_table2);
f.write('<div id="textboard" name="textboard" style="display:none;background:black;border:1px solid #4B689E;width:160px;height:100px;position:absolute;left:0px;top:0px"></div>');
f.write('</td></tr></table>');
f.write('<div id="wog_message_box"></div>');

}

function status_view2(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,x_name,y_name,z_name,book_name,god_name,p_place,p_birth,p_cdate,p_url,p_homename,s_ch_name,win_num,p_rebirth,p_grade,p_pt,p_sppt,p_luck,p_status,p_group,p_style,suit_namea)
{
	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";
	}
	var sex="";
	(p_sex=="1")?sex="男":sex="女";
		p_s=s_status(p_s);
	var p_strf=get_f(p_str,50000);
	var p_smartf=get_f(p_smart,50000);
	var p_aglf=get_f(p_agl,50000);
	var p_lifef=get_f(p_life,50000);
	var p_auf=get_f(p_au,50000);
	var p_bef=get_f(p_be,50000);
	var p_vitf=get_f(p_vit,50000);
	var p_atf=get_f(p_at,50000);
	var p_matf=get_f(p_mat,50000);
	var p_dff=get_f(p_df,50000);
	var p_mdff=get_f(p_mdf,50000);
	   //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;   var exp_img1=""; 
   var exp_img2=""; 
   var hp_img1=""; 
   var hp_img2=""; 
   if(p_expf >= 1)   {exp_img1='<img src="'+img+'bar/bxg.gif" width="'+p_expf+'%" height="9" title="'+p_expf+'%">';} 
   if(p_nextexpf >= 1)   {exp_img2='<img src="'+img+'bar/bhg.gif" width="'+p_nextexpf+'%" height="9" title="'+p_expf+'%">';} 
   if(p_hpf >= 1)   {hp_img1='<img src="'+img+'bar/bxg.gif" width="'+p_hpf+'%" height="9" title="'+p_hpf+'%">';} 
   if(p_hpmaxf >= 1)   {hp_img2='<img src="'+img+'bar/bhg.gif" width="'+p_hpmaxf+'%" height="9" title="'+p_hpf+'%">';} 
   //EXP&HPbar_End 

f.write('<center><img src="./img/stat.gif"></center>');
f.write(temp_table1);
f.write('<tr><td width="60%">');
f.write(temp_table1);
f.write('<tr><td colspan="2">勝場 '+p_win+' / 敗場 '+p_lost+'　(獲勝率:'+Math.floor((p_win/(p_win+p_lost))*100)+'%)</td></tr>');
f.write('<tr><td colspan="2"><img src="'+p_img+'" border="0" ></td></tr>');
f.write('<tr><td bgcolor="#000099">金錢</td><td><b>-----</b></td></tr>');
f.write('<tr><td bgcolor="#000099">霧靈鬼魂</td><td><b>-----</b></td></tr>');
f.write('<tr><td bgcolor="#000099">幻想點數</td><td><b>-----</b></td></tr>');
f.write('<tr><td bgcolor="#996600">冒險地</td><td ><b>'+section.getPlace(p_place)+'</b></td></tr>');
f.write('<tr><td bgcolor="#990099">出生地</td><td ><b>'+birth[p_birth]+'</b></td></tr>');
f.write('<tr><td>Exp</td><td>'+exp_img1+exp_img2+'<b>'+Math.floor((p_exp/p_nextexp)*100)+'%</b></td></tr>');
f.write('<tr><td>HP</td><td>'+hp_img1+hp_img2+'<b>'+p_hp+'/'+p_hpmax+'</b></td></tr>');
f.write('</table></td><td width="40%">');
f.write(temp_table1);
f.write('<tr><td bgcolor="#006600">勇者姓名</td><td><b>'+p_name+' ('+sex+' '+p_cdate+'歲)</b></td></tr>');
f.write('<tr><td bgcolor="#006600">等級</td><td><b>'+p_rebirth+' 轉 '+p_lv+' 級</b></td></tr>');
f.write('<tr><td bgcolor="#006600">職業</td><td><b>'+p_s+'屬 '+ch_name+'</b></td></tr>');
if(p_grade != ''){
f.write('<tr><td bgcolor="#006600">官職</td><td ><b>'+p_grade+'</b></td></tr>');
}else{
f.write('<tr><td bgcolor="#006600">官職</td><td ><b>平民</b></td></tr>');
}
if(d_s_ch_name != ''){
f.write('<tr><td bgcolor="#006600">奧義</td><td ><b>'+s_ch_name+'奧義</b></td></tr>');
}else{
f.write('<tr><td bgcolor="#006600">奧義</td><td ><b>未有裝備奧義</b></td></tr>');
}
if(p_group != ''){
f.write('<tr><td bgcolor="#E6C075">所屬公會</td><td><b>'+p_group+'</b></td></tr>');
}else{
f.write('<tr><td bgcolor="#E6C075">所屬公會</td><td><b>未有所屬公會</b></td></tr>');
}
if(p_style != ''){
f.write('<tr><td bgcolor="#E6C075">公會頭銜</td><td><b>'+p_style+'</b></td></tr>');
}else{
f.write('<tr><td bgcolor="#E6C075">公會頭銜</td><td><b>未有公會頭銜</b></td></tr>');
}
f.write('<tr><td bgcolor="#3300FF">守護者</td><td><b><span onmouseover="parent.textboard_view('+desc_id[11]+',event)" onmouseout="parent.textboard_close()">'+god_name+'</span></b></td>');
if(win_num != 'undefined')
{
f.write('<tr><td>連勝紀錄</td><td>'+win_num+' 連勝中</td></tr>')	
}
f.write('</table>');
f.write('</hr>');
f.write('<table border=0 width=300>');
f.write('<tr><td><fieldset style="height:100; width:300;"><legend>個人狀態及廣告區</legend><b>'+p_status+'</b></fieldset></td></tr>');
f.write('</table>');
f.write('</td></tr></table>');
f.write('<hr>');
f.write(temp_table1);
f.write('<tr><td colspan="8" bgcolor="#555555"><b>角色能力</b></td></tr>');
f.write('<tr><td bgcolor="#555555">力量</td><td class="b"><b>'+p_str+'</b></td>');
f.write('<td bgcolor="#555555">敏捷</td><td class="b"><b>'+p_agl+'</b></td>');
f.write('<td bgcolor="#555555">魅力</td><td class="b"><b>'+p_au+'</b></td>');
f.write('<td bgcolor="#555555">體質</td><td class="b"><b>'+p_vit+'</b></td></tr>');
f.write('<tr><td bgcolor="#555555">智力</td><td class="b"><b>'+p_smart+'</b></td>');
f.write('<td bgcolor="#555555">生命</td><td class="b"><b>'+p_life+'</b></td>');
f.write('<td bgcolor="#555555">信仰</td><td class="b"><b>'+p_be+'</b></td>');
f.write('<td bgcolor="#555555">運氣</td><td class="b"><b>-----</b></td></tr>');
f.write('</table>');
f.write('<hr>');
f.write(temp_table1);
f.write('<tr><td colspan="4" bgcolor="#555555"><b>角色數值</b></td></tr>');
f.write('<tr><td width="10%" bgcolor="#555555">物攻</td><td class="b1" width="40%"><img src="'+img+'bar/bmg.gif" width="'+p_atf+'%" height="9"><b>'+p_at+'</b></td></tr>')
f.write('<tr><td width="10%" bgcolor="#555555">物防</td><td class="b1" width="40%"><img src="'+img+'bar/bmg.gif" width="'+p_dff+'%" height="9"><b>'+p_df+'</b></td></tr>')
f.write('<tr><td width="10%" bgcolor="#555555">魔攻</td><td class="b1" width="40%"><img src="'+img+'bar/bmg.gif" width="'+p_matf+'%" height="9"><b>'+p_mat+'</b></td></tr>')
f.write('<tr><td width="10%" bgcolor="#555555">魔防</td><td class="b1" width="40%"><img src="'+img+'bar/bmg.gif" width="'+p_mdff+'%" height="9"><b>'+p_mdf+'</b></td></tr>')
f.write('</tr></table>');
f.write('<hr>');
f.write(temp_table1);
f.write('<tr><td colspan="5" bgcolor="#555555"><b>角色裝備 【 '+suit_namea+' 】</b></td></tr>');
f.write('<tr>');
f.write('<td>武器<br><img src="./img/eq/weapon2.gif"><br><b><span onmouseover="parent.textboard_view('+desc_id[0]+',event)" onmouseout="parent.textboard_close()">'+a_name+'</span></b></td>');
f.write('<td>頭部<br><img src="./img/eq/head2.gif"><br><b><span onmouseover="parent.textboard_view('+desc_id[1]+',event)" onmouseout="parent.textboard_close()">'+e_name+'</span></b></td>');
f.write('<td>身體<br><img src="./img/eq/body2.gif"><br><b><span onmouseover="parent.textboard_view('+desc_id[2]+',event)" onmouseout="parent.textboard_close()">'+d_name+'</span></b></td>');
f.write('<td>手部<br><img src="./img/eq/hand2.gif"><br><b><span onmouseover="parent.textboard_view('+desc_id[3]+',event)" onmouseout="parent.textboard_close()">'+dd_name+'</span></b></td>');
f.write('<td>腳部<br><img src="./img/eq/foot2.gif"><br><b><span onmouseover="parent.textboard_view('+desc_id[4]+',event)" onmouseout="parent.textboard_close()">'+c_name+'</span></b></td>');
f.write('</tr><tr>');
f.write('<td>道具<br><img src="./img/eq/item2.gif"><br><b><span onmouseover="parent.textboard_view('+desc_id[5]+',event)" onmouseout="parent.textboard_close()">'+item_name+'</span></b></td>');
f.write('<td>座騎<br><img src="./img/eq/car2.gif"><br><b><span onmouseover="parent.textboard_view('+desc_id[8]+',event)" onmouseout="parent.textboard_close()">'+y_name+'</span></b></td>');
f.write('<td>護符<br><img src="./img/eq/card2.gif"><br><b><span onmouseover="parent.textboard_view('+desc_id[7]+',event)" onmouseout="parent.textboard_close()">'+x_name+'</span></b></td>');
f.write('<td>幻想卡<br><img src="./img/eq/ca2.gif"><br><b><span onmouseover="parent.textboard_view('+desc_id[9]+',event)" onmouseout="parent.textboard_close()">'+z_name+'</span></b></td>');
f.write('<td>幻戰書<br><img src="./img/eq/book2.gif"><br><b><span onmouseover="parent.textboard_view('+desc_id[10]+',event)" onmouseout="parent.textboard_close()">'+book_name+'</span></b></td>');
f.write('</tr></table>');
f.write(temp_table2);
f.write('<div id="textboard" name="textboard" style="display:none;background:black;border:1px solid #4B689E;width:160px;height:100px;position:absolute;left:0px;top:0px"></div>');
f.write('</td></tr></table>');
f.write('<div id="wog_message_box"></div>');
}



var txt = new Array(); 
var desc_id=new Array(0,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) 
{ 
   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;
         case 11: 
         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?ch_name:'無'; 
      if(send==1) 
      { 
         send='<tr><td colspan="2" bgcolor="#444444" style="border:1px solid #4B689E">已綁定</td></tr>'; 
      }else 
      { 
         send=""; 
      } 
      txt[id]='<table border=0 width="100%" style="font-size:9px"><tr><td style="border:1px solid #4B689E"><table border=0 width="100%"><tr><td width="75%" style="text-align:left">'+name+s+'</td><td width="25%">'+d_type+'</td></tr></table></td></tr><tr><td colspan="2" style="text-align:left">物攻擊力：'+at+'<br>魔攻擊力：'+mat+'<br>物防禦力：'+df+'<br>魔防禦力：'+mdf+'<br>速度：'+agl+'<br>需求力量：'+mstr+'<BR>需求速度：'+magl+'<BR>需求智力：'+msmart+' <BR>限定職業：'+ch_name+'</td></tr>'+send+'</table>'; 
   } 
} 
function textboard_view(txt_id,event) 
{ 
   var board=parent.wog_view.textboard; 
   var f=parent.wog_view.frameElement; 
   if(!txt[txt_id])return false; 
   board.innerHTML=txt[txt_id]; 
   Bwidth=parseInt(board.style.width),Bheight=parseInt(board.style.height); 
   var Bleft=(event.clientX+Math.ceil(Bwidth*5/4)+5 >= f.width)?event.clientX-Math.ceil(Bwidth*5/4):event.clientX+Math.floor(Bwidth/4); 
   var Btop=(event.clientY+Math.ceil(Bheight/2)+5 >= f.height)?event.clientY-Bheight:event.clientY-Math.floor(Bheight/2);
   board.style.left=Bleft; 
   board.style.top=Math.floor(Btop+300); 
   board.style.display=""; 
} 
function textboard_close() 
{ 
   parent.wog_view.textboard.style.display="none"; 
}

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('<center>WOG-遊戲方式 <font color="#FF0000">看玩遊戲說明再創造角色</font></center>');
	f.write('<OL>');
	f.write('<LI>首先必須先加入論壇會員以及登入論壇才能創造角色。');
	f.write('<LI>點選「角色作成」按鈕，作成新角色。');
	f.write('<LI>角色作成之後，便可利用設定的帳號和密碼進入遊戲。');
	f.write('<LI>角色作成完成後，從頁面右上角登入，即可進入你個人的專屬舞台。');
	f.write('<LI>在個人專屬舞台裡，你可以進行動作選擇。');
	f.write('<LI>玩家可利用限定的加分點數增加自己的能力值。(能力值的設定和人物的今後的職業有相當大的關聯，請慎重考量!!)');
	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>'+del_day+'</b></FONT>日未有登入帳號，帳號會自動刪除!!');
	f.write('<br>最新加入玩家：<font color=yellow>'+new_player+'</font> 目前玩家總數：<font color=yellow>'+player_num+'</font><br>');
	f.write('　　　站長：<font color=red><b>Stookie</b></font><br>');
	f.write('程式編寫員：<font color=blue><b>Thanato</b></font><br>');
	f.write('SA(管理員)：<font color=green><b>o魂o</b></font><br>');
	f.write('SGM(監控員)：<font color=orange><b></b></font><br>');
	f.write('GM(監控員)：<font color=purple><b>酷酷之家~寶庫　aeon</b></font><br>');
	f.write('　　　　　　<font color=purple><b>           </b></font><br>');
	f.write('<INPUT TYPE="hidden" NAME="act" VALUE="make">');
	f.write('<INPUT TYPE="hidden" NAME="f" VALUE="chara">');
	f.write('<center><INPUT TYPE="submit" VALUE=" 創造新角色 " style="'+sbutton+'"></form></center>');
	f.write('</OL>');
}

function king_view(sname,s)
{
	var view_name=parent.wog_view;
	view_name.document.write(temp_table1);
	view_name.document.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">';
		}

		view_name.document.write('<tr><td  width="110">'+p_img_url+'</td><td >'+s2[1]+'</td><td >'+s2[2]+'</td></tr>');
	}
	view_name.document.write(temp_table2);
}

function mr_view(s,adm) 
{ 
   message_cls(); 
	group_head();
   var view_name=parent.wog_view; 
   var adm_mode=""; 
   var border_w="70%"; 
   if(adm==1){adm_mode="<td>選項</td>";border_w="60%";} 
   view_name.document.write(temp_table1); 
   view_name.document.write('<tr><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){view_name.document.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{view_name.document.write('<tr><td  width='+border_w+'>'+s2[1]+'</td><td>'+s2[2]+'</td></tr>');} 
      } 
   }else 
   { 
      if(adm==1){view_name.document.write('<tr><td  width='+border_w+' colspan=3>無任何紀錄</td></tr>');} 
      else{view_name.document.write('<tr><td  width='+border_w+'>無任何紀錄</td></tr>');} 
   } 
   view_name.document.write(temp_table2); 
}

function system_view(s,d,instmsg)
{
	message_cls();
	var f=parent.wog_view.document;
	if(instmsg != 0) 
	{ 
		f.write('<center><img src="./img/inform.gif"></center>'); 
		f.write(temp_table1);
		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_table2); 
		f.write(hr); 
	}
	f.write("<table width=97% cellspacing=0 cellpadding=2 align=center valign=top><tr><td>");
	f.write(temp_table1);
	f.write('<tr><td colspan="2" bgcolor="#4B689E">各項記錄</td></tr>'); 
	f.write('<tr><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(temp_table2);
	f.write("</td><td width=50% valign=top>"); 
	f.write(temp_table1);
	f.write('<tr><td colspan="2" bgcolor="#4B689E">個人信箱</td></tr>'); 
	f.write('<tr><td>內容</td><td>發生時間</td></tr>');
	if(d!="")
	{
		var d1=d.split(";");
		for(var i=0;i<d1.length;i++)
		{	
			var d2=d1[i].split(",");
			f.write('<tr><td>'+d2[0]+'</td><td>'+d2[1]+'</td></tr>');
		}
	}else
	{
		f.write('<tr><td colspan="8" >尚未發生任何事件</td></tr>');	
	}
	f.write(temp_table2);
	f.write("</td></tr></table>");
}

function system_view_group(s,d,instmsg)
{
	message_cls();
	var f=parent.wog_view.document;
	group_head();
	f.write(temp_table1);
	f.write('<tr><td colspan="2" bgcolor="#4B689E">公會戰況</td></tr>'); 
	f.write('<tr><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(temp_table2);
}

function wog_log_save(s) 
{ 
   if(wog_log.length >= 15) 
   { 
      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); 
}

//##### bank #####
function bank(a,b)
{
	message_cls();
	var f=parent.wog_view.document;
	f.write('<center><img src="./img/logo_bank.gif"></center>');
	f.write('<table width="700" border="2" cellspacing="0" cellpadding="2" align="center" bordercolor="#868686">');
	f.write('<tr><td>身上現金:'+a+'</td><td>銀行存款:'+b+'</td></tr>');
	f.write(temp_table2);
	f.write('<br>');
	f.write('<table width="700" border="2" cellspacing="0" cellpadding="2" align="center" bordercolor="#868686">');
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<tr><td colspan="2" bgcolor="000099">存款服務</td></tr>');
	f.write('<tr><td><input type="text" name="money" size="5"></td><td><input type="submit" value="進行存款" style="'+sbutton+'" value="'+a+'"></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(temp_table2);
	f.write('<br>');
	f.write('<table width="700" border="2" cellspacing="0" cellpadding="2" align="center" bordercolor="#868686">');
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<tr><td colspan="4" bgcolor="000099">提款服務</td></tr>');
	f.write('<tr><td><input type="text" name="money" size="5"></td><td><input type="submit" value="進行提款" style="'+sbutton+'" value="'+b+'"></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(temp_table2);
	f.write('<br>');
	f.write('<table width="700" border="2" cellspacing="0" cellpadding="2" align="center" bordercolor="#868686">');
	f.write('<form name=f1>');
	f.write('<tr><td colspan="5" bgcolor="000099">轉帳服務(將收取1%手續費,等級150才可使用)</td></tr>');
	f.write('<tr><td>轉帳金額</td><td>收款人帳號</td><td>確認安全密碼</td><td>---</td></tr>');
	f.write('<tr><td><input type="text" name="money" size="5"></td><td><input type="text" name="pay_id" size="6"></td><td><input type="password" name="pw" size="6"></td><td><input type="button" value="進行轉帳" onclick="parent.data_send(\'bank\',\'pay\',document.f1.pay_id.value,document.f1.money.value,null,document.f1.pw.value)" style="'+sbutton+'"></td></tr>');
	f.write('</form>');
	f.write(temp_table2);
}

//#### arm begin ####
function arm_view(a,d,temp_id,bag,arm)
{
	message_cls();
	var f=parent.wog_view.document;
	vData=d;
	arm_head();
	f.write('<hr><tr><td colspan="11" >可使用的背包格數 ：'+bag+' </td></tr>');
	f.write('<form action="wog_act.php" method="post" target="mission" name=f2 >');
	f.write(temp_table1);
	f.write('<tr><td>NO</td><td>裝/轉</td><td>物攻</td><td>魔攻</td><td>物防</td><td>魔防</td><td>速度</td><td>名稱</td><td>金錢</td><td>霧靈</td><td>販/拍</td></tr>');

if(d!="0"){
	var s1=a.split(";");
	var listKey=0;
	var n=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++)
		{
			var att2="";
			var att3="";
			var send="";
			var job="";
			var abc="";
			n++;
			att2=""+att[s2[16]]+"";
			if(s2[16]>0){
			att3="<img src='http://wog.we-u.net/img/att.jpg' alt='"+att2+"'>";
			}else{
			att3="";
			}
			if(s3!=null)
			{
				var temp_num="*"+s3[j];
			}else
			{
				var temp_num="";
			}
			var arm_view_color="";
			if(s2[12]=="1")
			{
				arm_view_color="bgcolor="+nosend;
			}
			abc="<acronym title='力量:"+s2[8]+" 速度:"+s2[9]+" 智力:"+s2[10]+" 轉生:"+s2[14]+" 職業:"+s2[11]+"'>限制</acronym>";
			f.write('<tr '+arm_view_color+' onMouseOver="this.style.backgroundColor=\'#777779\'" onMouseOut="this.style.backgroundColor=\'\'" onclick="parent.setRadioValue(\'adds\','+s2[0]+');parent.setRadioValue(\'items\',\''+s2[0]+','+s2[5]+'\')" style="cursor:hand"><td>'+n+'</td><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><a href="javascript:parent.data_send2(\'arm\',\'check_arm\',\''+temp_id+'\','+s2[0]+','+n+')">'+s2[5]+'</a>'+temp_num+att3+'</td><td>'+s2[4]+'</td><td>'+s2[15]+'</td><td><input type="radio" name="items" value="'+s2[0]+','+s2[5]+'"></td></tr>');
			listKey++;
		}
	}
}else{
f.write('<tr><td colspan=11>裝備欄內沒有任何裝備</td></tr>');
}
	var s1=arm.split(",");
	f.write('<tr bgcolor="#777779"><td>---</td><td>---</td><td>'+s1[0]+'</td><td>'+s1[1]+'</td><td>'+s1[2]+'</td><td>'+s1[3]+'</td><td>'+s1[4]+'</td><td>'+s1[10]+'</td><td>'+s1[11]+'</td><td>'+s1[12]+'</td><td>---</td></tr>');
	f.write('<tr><td colspan="11" ><input type="submit" value="裝備" style="'+sbutton+'"> <input type="button" value="卸下" onclick="parent.foot_trun(\'arm\',\'demount\',\''+temp_id+'\')" style="'+sbutton+'"> <input type="button" value="轉移" onClick="parent.data_send(\'arm\',\'move\',document.f2.pay_id.value,document.f2.item_num.value,document.f2.adds,document.f2.pw.value)" style="'+sbutton+'"> <input type="button" value="販賣" style="'+sbutton+'" onClick=if(confirm("確定販賣？")){parent.data_send(\'arm\',\'sale\',\''+temp_id+'\',document.f2.item_num.value,document.f2.adds,document.f2.pw.value)}> <input type="button" value="擺攤" onClick="parent.sale_item(document.f2.items,document.f2.pay_id.value)" style="'+sbutton+'"> <input type="button" value="換印花" style="'+sbutton+'" onClick=if(confirm("確定轉換？")){parent.data_send(\'arm\',\'stamp\',\''+temp_id+'\',document.f2.item_num.value,document.f2.adds,document.f2.pw.value)}></td></tr>');
if(temp_id=="d_item_id"){
	f.write('<tr><td colspan="11" >請選擇數量:<input type="text" name="item_num" value="1" size="2" maxlength="2"> (最大30)');
	f.write('(使用轉移,販賣及換印花記得選擇道具數量)</td></tr>');
}else{
	f.write('<input type="hidden" name="item_num" value="1">');
}
	f.write('<tr><td colspan="11" >欲轉移需輸入對方遊戲的帳號 <input type="text" name="pay_id" size="16"> 安全密碼 <input type="password" name="pw" size="16"></td></tr>');
	f.write(temp_table2);
	f.write('<input type="hidden" name="f" value="arm">');	
	f.write('<input type="hidden" name="act" value="setup">');
	f.write('</form>');
	f.write('<div id="armview" name="armview" style="display:none;background:black;border:1px solid #4B689E;width:160px;height:100px;position:absolute;left:0px;top:0px"></div>');
	f.write('<div id="wog_message_box"></div>');
}

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_card_id":
			d_card_name=b;
			return;
			break;
		case "d_car_id":
			d_car_name=b;
			return;
			break;
		case "d_ca_id":
			d_ca_name=b;
			return;
			break;
		case "d_book_id":
			d_book_name=b;
			return;
			break;
		case "d_god_id":
			d_god_name=b;
			return;
			break;
	}
	return;
}
function arm_end(s)
{
	var view_name=parent.wog_view;
	message_cls();
	view_name.document.write(temp_table1);
	if(s==1)
	{
		view_name.document.write('<tr><td>裝備完成</td></tr>')
	}
	if(s==2)
	{
		view_name.document.write('<tr><td>轉移完成</td></tr>')
	}
	view_name.document.write(temp_table2);
}
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,temp_id) 
{ 
	var f=parent.wog_view.document;
	message_cls();
	vData=d; 
	f.write(temp_table1);
	f.write('<form action="wog_act.php" method="post" name=f1 target="mission">');
	f.write('<tr><td><img src="./img/eq/weapon2.gif"><br>武器</td><td><img src="./img/eq/head2.gif"><br>頭部</td><td><img src="./img/eq/body2.gif"><br>身體</td><td><img src="./img/eq/hand2.gif"><br>手部</td><td><img src="./img/eq/foot2.gif"><br>腳部</td><td><img src="./img/eq/item2.gif"><br>道具</td><td><img src="./img/eq/card2.gif"><br>護符</td><td><img src="./img/eq/car2.gif"><br>座騎</td><td><img src="./img/eq/ca2.gif"><br>幻想卡</td><td><img src="./img/eq/book2.gif"><br>幻戰書</td><td><img src="./img/eq/god2.gif"><br>守護者</td></tr><tr>');
	f.write('<td onmouseover="this.style.color=\'white\';this.style.backgroundColor=\'#4B689E\'" onmouseout="this.style.color=\'white\';this.style.backgroundColor=\'\'" onClick="parent.act_click(\'arm\',\'view\',\'a_id\')">裝備</td>');
	f.write('<td onmouseover="this.style.color=\'white\';this.style.backgroundColor=\'#4B689E\'" onmouseout="this.style.color=\'white\';this.style.backgroundColor=\'\'" onClick="parent.act_click(\'arm\',\'view\',\'d_head_id\')">裝備</td>');
	f.write('<td onmouseover="this.style.color=\'white\';this.style.backgroundColor=\'#4B689E\'" onmouseout="this.style.color=\'white\';this.style.backgroundColor=\'\'" onClick="parent.act_click(\'arm\',\'view\',\'d_body_id\')">裝備</td>');
	f.write('<td onmouseover="this.style.color=\'white\';this.style.backgroundColor=\'#4B689E\'" onmouseout="this.style.color=\'white\';this.style.backgroundColor=\'\'" onClick="parent.act_click(\'arm\',\'view\',\'d_hand_id\')">裝備</td>');
	f.write('<td onmouseover="this.style.color=\'white\';this.style.backgroundColor=\'#4B689E\'" onmouseout="this.style.color=\'white\';this.style.backgroundColor=\'\'" onClick="parent.act_click(\'arm\',\'view\',\'d_foot_id\')">裝備</td>');
	f.write('<td onmouseover="this.style.color=\'white\';this.style.backgroundColor=\'#4B689E\'" onmouseout="this.style.color=\'white\';this.style.backgroundColor=\'\'" onClick="parent.act_click(\'arm\',\'view\',\'d_item_id\')">裝備</td>');
	f.write('<td onmouseover="this.style.color=\'white\';this.style.backgroundColor=\'#4B689E\'" onmouseout="this.style.color=\'white\';this.style.backgroundColor=\'\'" onClick="parent.act_click(\'arm\',\'view\',\'d_card_id\')">裝備</td>');
	f.write('<td onmouseover="this.style.color=\'white\';this.style.backgroundColor=\'#4B689E\'" onmouseout="this.style.color=\'white\';this.style.backgroundColor=\'\'" onClick="parent.act_click(\'arm\',\'view\',\'d_car_id\')">裝備</td>');
	f.write('<td onmouseover="this.style.color=\'white\';this.style.backgroundColor=\'#4B689E\'" onmouseout="this.style.color=\'white\';this.style.backgroundColor=\'\'" onClick="parent.act_click(\'arm\',\'view\',\'d_ca_id\')">裝備</td>');
	f.write('<td onmouseover="this.style.color=\'white\';this.style.backgroundColor=\'#4B689E\'" onmouseout="this.style.color=\'white\';this.style.backgroundColor=\'\'" onClick="parent.act_click(\'arm\',\'view\',\'d_book_id\')">裝備</td>');
	f.write('<td onmouseover="this.style.color=\'white\';this.style.backgroundColor=\'#4B689E\'" onmouseout="this.style.color=\'white\';this.style.backgroundColor=\'\'" onClick="parent.act_click(\'arm\',\'view\',\'d_god_id\')">裝備</td>');
	f.write('</tr>');
	f.write('<tr>');
	f.write('<td onmouseover="this.style.color=\'white\';this.style.backgroundColor=\'#4B689E\'" onmouseout="this.style.color=\'white\';this.style.backgroundColor=\'\'" onClick="parent.act_click(\'syn\',\'view\',\'a_id\')">精鍊</td>');
	f.write('<td onmouseover="this.style.color=\'white\';this.style.backgroundColor=\'#4B689E\'" onmouseout="this.style.color=\'white\';this.style.backgroundColor=\'\'" onClick="parent.act_click(\'syn\',\'view\',\'d_head_id\')">精鍊</td>');
	f.write('<td onmouseover="this.style.color=\'white\';this.style.backgroundColor=\'#4B689E\'" onmouseout="this.style.color=\'white\';this.style.backgroundColor=\'\'" onClick="parent.act_click(\'syn\',\'view\',\'d_body_id\')">精鍊</td>');
	f.write('<td onmouseover="this.style.color=\'white\';this.style.backgroundColor=\'#4B689E\'" onmouseout="this.style.color=\'white\';this.style.backgroundColor=\'\'" onClick="parent.act_click(\'syn\',\'view\',\'d_hand_id\')">精鍊</td>');
	f.write('<td onmouseover="this.style.color=\'white\';this.style.backgroundColor=\'#4B689E\'" onmouseout="this.style.color=\'white\';this.style.backgroundColor=\'\'" onClick="parent.act_click(\'syn\',\'view\',\'d_foot_id\')">精鍊</td>');
	f.write('<td onmouseover="this.style.color=\'white\';this.style.backgroundColor=\'#4B689E\'" onmouseout="this.style.color=\'white\';this.style.backgroundColor=\'\'" onClick="parent.act_click(\'syn\',\'view\',\'d_item_id\')">精鍊</td>');
	f.write('<td onmouseover="this.style.color=\'white\';this.style.backgroundColor=\'#4B689E\'" onmouseout="this.style.color=\'white\';this.style.backgroundColor=\'\'" onClick="parent.act_click(\'syn\',\'view\',\'d_card_id\')">精鍊</td>');
	f.write('<td onmouseover="this.style.color=\'white\';this.style.backgroundColor=\'#4B689E\'" onmouseout="this.style.color=\'white\';this.style.backgroundColor=\'\'" onClick="parent.act_click(\'syn\',\'view\',\'d_car_id\')">精鍊</td>');
	f.write('<td onmouseover="this.style.color=\'white\';this.style.backgroundColor=\'#4B689E\'" onmouseout="this.style.color=\'white\';this.style.backgroundColor=\'\'" onClick="parent.act_click(\'syn\',\'view\',\'d_ca_id\')">精鍊</td>');
	f.write('<td onmouseover="this.style.color=\'white\';this.style.backgroundColor=\'#4B689E\'" onmouseout="this.style.color=\'white\';this.style.backgroundColor=\'\'" onClick="parent.act_click(\'syn\',\'view\',\'d_book_id\')">精鍊</td>');
	f.write('<td onmouseover="this.style.color=\'white\';this.style.backgroundColor=\'#4B689E\'" onmouseout="this.style.color=\'white\';this.style.backgroundColor=\'\'" onClick="parent.act_click(\'syn\',\'view\',\'d_god_id\')">精鍊</td>');
	f.write('</tr>');
	f.write('<input type="hidden" name="f" value="">');
	f.write('<input type="hidden" name="act" value="">');
	f.write('<input type="hidden" name="temp_id" value="">');
	f.write('</form>');
	f.write(temp_table2);
	f.write('<form action="wog_act.php" method="post" target="mission" name="f2">'); 
	f.write(temp_table1); 
	f.write('<tr><td colspan="9"><p align=center>歡迎來到精鍊中心，你可以在這裡升級你的裝備，首先，裝備必需<b><font color=red>可</font></b>精鍊<br>第二，升級裝備必須要有裝備類型對應的精鍊石，分別是<font color=red>天</font><font color=orange>帝</font><font color=yellow>戰</font><font color=green>泣</font><font color=lightgreen>聖</font><font color=blue>戒</font><font color=purple>斷</font><font color=white>真</font><font color=grey>神</font>九種精鍊石<br>不過，精鍊前請考慮風險，因為精鍊裝備會有機會失敗，導致裝備消失！<a href="http://wog.we-u.net/data/dsyn.html" target="_blank"><font color=ffffff>精鍊教學按此</font></a></p></td></tr>');
	f.write('<tr><td>合成選擇</td><td>物理攻擊力</td><td>魔力攻擊力</td><td>物理防禦力</td><td>魔力防禦力</td><td>提升速度</td><td>名稱</td><td>價格</td><td>精鍊</td></tr>'); 
	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="";
			}
			if(s2[11] == "0")
			{
			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><td>不可</td></tr>'); 
			}
			if(s2[11] == "1")
			{
			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><td>可</td></tr>'); 
			}
		} 
	} 
	f.write('<tr><td colspan="10" >選擇合成方式：<select name="syn_way">'); 
	var syn_option=new Array();  
	syn_option[2]="<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="交給工匠" style="'+sbutton+'"></tr>'); 
	f.write(temp_table2);
	f.write('<input type="hidden" name="f" value="syn">');    
	f.write('<input type="hidden" name="act" value="purify">');  
	f.write('</form>'); 
} 
function syn_end(s,end) 
{ 
	var f=parent.wog_view.document; 
	message_cls(); 
	f.write(temp_table1); 
	f.write('<tr><td>在合成的途中合成爐突然發出閃閃的白光！<BR><p align=center><font size=7><b>轟隆隆隆隆隆隆隆隆隆隆！</b></p></font>'); 
	var timerID=setTimeout('syn_end_view("'+s+'","'+end+'")',1000); 
	f.write('</td></tr>'+temp_table2+"<br>"); 
} 
function syn_end_view(s,end) 
{ 
	var f=parent.wog_view.document; 
	f.write(temp_table1+'<tr><td>'); 
	if(end==1)//合成成功 
	{f.write('你的眼前出現了一個閃閃發亮的物品，這次的合成似乎是成功了！<br><br>合成結果： <font color=#ffffaf>'+s+'</font> 入手！');} 
	if(end==2)//編號錯誤 
	{f.write('你合出了一團無法辨識的東西，或許是一團垃圾....');} 
	if(end==3)//合成失敗 
	{f.write('你的眼前出現了一團灰燼....。');} 
	if(end==4)//裝備過多 
	{f.write('合成成功！但因為裝備欄已滿，所以裝備掉下被不明人士撿走，請自認倒楣。');}
	f.write('</td></tr>'+temp_table2); 
} 
function syn_end2(s,end) 
{ 
	var f=parent.wog_view.document; 
	message_cls(); 
	f.write(temp_table1); 
	f.write('<tr><td><p align=center>物品精鍊中...請等待...<BR><font size=7><b>叮叮鏗鏗叮叮鏗鏗</b></p></font>'); 
	var timerID=setTimeout('syn_end3()',1500);
	var timerID=setTimeout('syn_end3()',3000);
	var timerID=setTimeout('syn_end3()',4500);
	var timerID=setTimeout('syn_end3()',6000);
	var timerID=setTimeout('syn_end_view2("'+s+'","'+end+'")',7500); 
	f.write('</td></tr>'+temp_table2+"<br>"); 
} 
function syn_end3() 
{ 
	var f=parent.wog_view.document; 
	f.write(temp_table1); 
	f.write('<tr><td><p align=center>等</p></font>'); 
	f.write('</td></tr>'+temp_table2+"<br>"); 
} 
function syn_end_view2(s,end) 
{ 
	var f=parent.wog_view.document; 
	f.write(temp_table1+'<tr><td>'); 
	if(end==1)//合成成功 
	{f.write('精鍊成功<br><br>裝備變成了： <font color=#ffffaf>'+s+'</font> ');} 
	if(end==2)//編號錯誤 
	{f.write('錯誤精鍊，變了一團煙');} 
	if(end==3)//合成失敗 
	{f.write('精鍊失敗，物品消失了');} 
	if(end==4)//裝備過多 
	{f.write('精鍊成功！但因為裝備欄已滿，所以裝備掉下被不明人士撿走，請自認倒楣。');}
	if(end==5)//防爆 
	{f.write('精鍊失敗，裝有防爆卡，物品保留！');} 
	f.write('</td></tr>'+temp_table2); 
} 
function syn_view_special(syntotal,page,s,type)
{
	message_cls();
	var f=parent.wog_view.document;
	f.write('<form action="wog_act.php" method="post" name="pageform" target="mission">');
	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('<form action="wog_act.php" method="post" target="mission" name=f1>');
	f.write(temp_table1);
	f.write('<tr><td colspan="14"><a href=javascript:parent.sel_type("0");>武器</a> <a href=javascript:parent.sel_type("1");>頭部</a>  <a href=javascript:parent.sel_type("2");>身體</a> <a href=javascript:parent.sel_type("3");>手套</a> <a href=javascript:parent.sel_type("4");>鞋子</a> <a href=javascript:parent.sel_type("5");>道具</a> <a href=javascript:parent.sel_type("7");>護符</a> <a href=javascript:parent.sel_type("8");>座騎</a> <a href=javascript:parent.sel_type("9");>幻想卡</a> <a href=javascript:parent.sel_type("10");>幻戰書</a></td></tr>');
	f.write('<tr><td colspan="14" class=b1>我是合成大師,專門替冒險者合成一般商店沒有販賣的物品,我的合成是要收費的,每樣物品手續費2000元,但是先提醒合成是有風險的。我的師父愛德華是傳說中的合成天才,能合成稀有物品,目前他四處雲遊冒險,有緣您會遇到他</td></tr>');
	f.write('<tr><td colspan="14">請選擇想製作的物品</td></tr>');
	f.write('<tr><td rowspan="2"></td><td rowspan="2">名稱</td><td rowspan="2">物攻</td><td rowspan="2">魔攻</td><td rowspan="2">物防</td><td rowspan="2">魔防</td><td rowspan="2">速度</td><td rowspan="2">屬性</td><td colspan="6">能力限制</td></tr>');
	f.write('<tr><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="";
			var att2="";
			var att3="";
			var job="";
			if(s2[13]=="1")
			{
				arm_view_color="bgcolor="+nosend;
			}
			if(s2[10]!="" || s2[10]=="0")
			{
				job=s2[10]+job_pro(s2[12])+"%";
			}else{
				job="無";
			}
			att2=""+att[s2[15]]+"";
			if(s2[15]>0){
			att3="<img src='http://wog.we-u.net/img/att.jpg' alt='"+att2+"'>";
			}else{
			att3="";
			}
			f.write('<tr '+arm_view_color+' onMouseOver="this.style.backgroundColor=\'#777779\'" onMouseOut="this.style.backgroundColor=\'\'" onclick="parent.setRadioValue(\'syn_id\','+s2[9]+');" style="cursor:hand"><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>'+att3+'</td><td>'+s2[1]+'</td><td>'+s2[2]+'</td><td>'+s2[3]+'</td><td>'+s2[4]+'</td><td>'+s2[5]+'</td><td>'+s_status(s2[11])+'</td><td>'+s2[6]+'</td><td>'+s2[7]+'</td><td>'+s2[8]+'</td><td>'+s2[16]+'</td><td>'+s2[17]+'</td><td>'+job+'</td></tr>');
		}
	}
	f.write('<tr><td colspan="14"><input type="submit" value="確定合成" style="'+sbutton+'"></td></tr>'); 
	f.write(temp_table2);
	f.write('<input type="hidden" name="f" value="syn">');    
	f.write('<input type="hidden" name="act" value="special">'); 
	f.write('</form>'); 	
f.write('<div id="wog_message_box"></div>');
}
function syn_detail(s,syn_id,d_name)
{
	message_cls();
	var f=parent.wog_view.document;
	f.write('<form action="wog_act.php" method="post" target="mission" name=f1>');
	f.write(temp_table1);
	f.write('<tr><td>製作'+d_name+'需要下列物品</td></tr>'); 
	f.write('<tr><td>'+s+'</td></tr>'); 
	f.write('<tr><td><input type="button" value="取消合成" onclick="history.go(-1)" style="'+sbutton+'"> <input type="submit" value="確定合成" style="'+sbutton+'"></td></tr>'); 
	f.write(temp_table2);
	f.write('<input type="hidden" name="f" value="syn">');    
	f.write('<input type="hidden" name="act" value="special">'); 
	f.write('<input type="hidden" name="syn_id" value="'+syn_id+'">');
	f.write('</form>'); 	
}
//##########----------syn_system_end----------##########
function arm_select()
{
	var f=parent.wog_view.document;
	message_cls();
	f.write('<center><img src="./img/equipment.gif"></center>');
	f.write(temp_table1);
	f.write('<form method="post" target="mission">');
	f.write('<tr><td><input type="button" value="武器裝具" onClick="parent.act_click(\'arm\',\'view\',\'a_id\')" style="'+sbutton+'"></td><td><input type="button" value="頭部裝具" onClick="parent.act_click(\'arm\',\'view\',\'d_head_id\')" style="'+sbutton+'"></td><td><input type="button" value="身體裝具" onClick="parent.act_click(\'arm\',\'view\',\'d_body_id\')" style="'+sbutton+'"></td><td><input type="button" value="手部裝具" onClick="parent.act_click(\'arm\',\'view\',\'d_hand_id\')" style="'+sbutton+'"></td><td><input type="button" value="腳部裝具" onClick="parent.act_click(\'arm\',\'view\',\'d_foot_id\')" style="'+sbutton+'"></td><td><input type="button" value="道具裝具" onClick="parent.act_click(\'arm\',\'view\',\'d_item_id\')" style="'+sbutton+'"></td><td><input type="button" value="護符裝具" onClick="parent.act_click(\'arm\',\'view\',\'d_card_id\')" style="'+sbutton+'"></td><td><input type="button" value="座騎裝具" onClick="parent.act_click(\'arm\',\'view\',\'d_car_id\')" style="'+sbutton+'"></td><td><input type="button" value="幻想卡庫" onClick="parent.act_click(\'arm\',\'view\',\'d_ca_id\')" style="'+sbutton+'"></td><td><input type="button" value="幻戰書櫃" onClick="parent.act_click(\'arm\',\'view\',\'d_book_id\')" style="'+sbutton+'"></td></tr>');
//##########----------syn_system_start----------########## 
	f.write('<tr><td><input type="button" value="武器精鍊" onClick="parent.act_click(\'syn\',\'view\',\'a_id\')" style="'+sbutton+'"></td><td><input type="button" value="頭盔精鍊" onClick="parent.act_click(\'syn\',\'view\',\'d_head_id\')" style="'+sbutton+'"></td><td><input type="button" value="鎧甲精鍊" onClick="parent.act_click(\'syn\',\'view\',\'d_body_id\')" style="'+sbutton+'"></td><td><input type="button" value="護手精鍊" onClick="parent.act_click(\'syn\',\'view\',\'d_hand_id\')" style="'+sbutton+'"></td><td><input type="button" value="長靴精鍊" onClick="parent.act_click(\'syn\',\'view\',\'d_foot_id\')" style="'+sbutton+'"></td><td><input type="button" value="道具精鍊" onClick="parent.act_click(\'syn\',\'view\',\'d_item_id\')" style="'+sbutton+'"></td><td><input type="button" value="護符精鍊" onClick="parent.act_click(\'syn\',\'view\',\'d_card_id\')" style="'+sbutton+'"></td><td><input type="button" value="座騎精鍊" onClick="parent.act_click(\'syn\',\'view\',\'d_car_id\')" style="'+sbutton+'"></td><td><input type="button" value="卡片精鍊" onClick="parent.act_click(\'syn\',\'view\',\'d_ca_id\')" style="'+sbutton+'"></td><td><input type="button" value="戰書精鍊" onClick="parent.act_click(\'syn\',\'view\',\'d_book_id\')" style="'+sbutton+'"></td></tr>'); 
//##########----------syn_system_end----------##########
	f.write('</form>');
	f.write(temp_table2);
}

//########## online peo begin ###########
function onlinelist(peo) 
{ 
	var f=parent.wog_peo.document; 
	message_cls(f,0); 
	f.write(online_temp_table1); 
	var secArr=new Array(); 
	var secNum=section.placeNum; 
	var boy=0; 
	var girl=0; 
	var rest=0;
	if(peo!="") 
	{ 
		f.write('<img src=./img/logo/summer.gif>');
		f.write('<tr bgcolor="#868686"><td>名稱</td><td>LV</td><td>轉生</td></tr>'); 
		var s1=peo.split(";"); 
		for(var i=0;i<s1.length;i++) 
		{ 
			var s2=s1[i].split(","); 
			var fcolor=psex(s2[1]); 
			(s2[1]=="1")?boy++:girl++; 
			s2[3]=(s2[3]==1)?"Y":"N"; 
			if(!secArr[s2[5]]) 
			secArr[s2[5]]=''; 
			if(s2[10]==0){name="";}
			if(s2[10]==1){name="(GM)";}
			if(s2[10]==2){name="(SGM)";}
			if(s2[10]==3){name="(SA)";}


		if(s2[8]>=1)
		{
			secArr[s2[5]]+='<tr><td><a href=javascript:parent.yesname("'+s2[0]+'") target="foot"><b><font color="#33FF00">'+s2[0]+'</font></b></a>'+name+'</td><td>'+s2[2]+'</td><td>'+s2[6]+'</td></tr>';

		rest++;
		}else{
			secArr[s2[5]]+='<tr><td><a href=javascript:parent.yesname("'+s2[0]+'") target="foot"><b><font color="'+fcolor+'">'+s2[0]+'</font></b></a>'+name+'</td><td>'+s2[2]+'</td><td>'+s2[6]+'</td></tr>';
		} 
		} 
		for(var i=0;i<secNum;i++) 
		{ 
			if(secArr[i]) 
			{ 
				f.write(secArr[i]); 
				f.write('<tr><td colspan="4">↗'+section.getPlace(i)+'練功↖<hr></td></tr>');
			}  
		} 
		f.write('<tr><td bgcolor="#868686" colspan="3"><font color="#66ccff">男生</font> '+boy+' 人、<font color="#ff99cc">女生</font> '+girl+' 人</td></tr>'); 
		f.write('<tr><td bgcolor="#868686" colspan="3">線上人數 '+s1.length+' 人、<font color="#33FF00">發呆</font> '+rest+' 人</td></tr>'); 
	}else{ 
		f.write('<tr><td colspan="3"  bgcolor="#868686">線上人數 0 人</td></tr>'); 
	} 
	f.write(temp_table2); 
}

//########## no_online peo begin ###########
function no_onlinelist(peo)
{
	var f=parent.wog_peo.document;
	message_cls(f,0);
	f.write(online_temp_table1);
	f.write('<tr><td colspan="3"  bgcolor="#2B4686">2分鐘後自動更新</td></tr>');
	f.write(temp_table2);
}

function yesname(s)
{
	parent.foot.document.f1.towho.options[0].value=s;
	parent.foot.document.f1.towho.options[0].text=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)
{
	message_cls();
	var f=parent.wog_view.document;
	f.write('<form action="wog_act.php" method="post" target="mission" name=f1 >');
	f.write(temp_table1);
	f.write('<tr><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(",","-");
		}
		f.write('<tr onMouseOver="this.style.backgroundColor=\'#777779\'" onMouseOut="this.style.backgroundColor=\'\'" onclick="parent.setRadioValue(\'job_id\','+s2[0]+');" style="cursor:hand"><td><input type="radio" name="job_id" 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><td>'+s2[8]+'</td><td>'+job_pro(s2[9])+'%</td></tr>');
	}
	f.write('<tr><td colspan="10" ><input type="button" value="變更職業" onClick="parent.foot_trun(\'job\',\'setup\',null,null,document.f1.job_id)" style="'+sbutton+'"> <input type="button" value="裝備奧義" onClick="parent.foot_trun(\'job\',\'get_skill\',null,null,document.f1.job_id)" style="'+sbutton+'"></td></tr>');
	f.write(temp_table2);
	f.write('</form>');
}
function job_pro(s)
{
	s=parseInt(s);
	s=Math.floor((s/3500)*100);
	return s;
}
function job_end(a,message)
{
	message_cls();
	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]="復活成功";
	s[20]="任務接受成功";
	s[21]="恭喜完成任務";
	s[22]="取消任務成功";
	s[23]="運氣已更改!";
	s[24]="官職已設定!";
	s[25]="聊天室頭銜已更改!";
	s[26]="安全密碼已更改!";
	s[27]="出價成功!";
	s[28]="密碼更改成功,已發送電郵通知!";
	s[29]="問題已成功回報,請等候回復!";
	s[30]="訊息發送成功!";
	f.write(temp_table1);
	if (a==6) 
	{ 
	f.write('<tr><td >'+s[a]+'!!</br><a href="javascript:history.back()">點此返回上一頁</a></td></tr>') 
	} 
	else 
	{ 
	f.write('<tr><td >'+s[a]+'!!</td></tr>') 
	}
	if(message)
	{
		while(message.indexOf("&n") > 0)
		{
			message=message.replace("&n","<br>");
		}
		f.write('<tr><td class=b1>'+message+'</td></tr>')
	}
	f.write(temp_table2);
}

function pk_view(stat)
{
	message_cls();
	var f=parent.wog_view.document;
	f.write(temp_table1); 
	f.write('<tr bgcolor="#4B689E"><td>更改狀態</td></tr>'); 
	f.write('<tr><td><textarea name="p_status" rows="10" cols="70">'+stat+'</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"><b>請勿輸入不雅文字，經查證將在【沒有警告】的情況下刪除該帳號</b></font></td></tr>'); 
	f.write(temp_table2);
}

function id_admin()
{
	message_cls();
	var f=parent.wog_view.document;
	f.write(temp_table1);
	f.write('<form action="wog_etc.php" target="mission">');
	f.write('<tr><td colspan="3" bgcolor="000099">查詢帳號,密碼,安全密碼</td></tr>');
	f.write('<tr><td>註冊電郵</td><td><input type="text" size="25"  name="email"></td><td><input type="submit" value="查詢密碼" style="'+sbutton+'"></td></tr>');
	f.write('<input type="hidden" name="f" value="password">');
	f.write('</form>');
	f.write('<form action="wog_act.php" method="post" target="mission" name="f1">');
	f.write('<tr><td colspan="3">　</td></tr>');
	f.write('<tr><td colspan="3" bgcolor="000099">更改登入密碼</td></tr>');
	f.write('<tr><td>原密碼<input type="password" name="opw" size="10" maxlength="10"></td><td>新密碼<input type="password" name="npw" size="10" maxlength="10"></td><td>確認新密碼<input type="password" name="npwc" size="10" maxlength="10"></td></tr>');
	f.write('<tr><td>安全密碼 <input type="password" name="cpwc" size="10" maxlength="20"></td><td colspan="2">註冊電郵<input type="text" name="email" size="25"></td></tr>');
	f.write('<tr><td colspan="3"><input type="button" value="確定更改" onClick="parent.data_send2(\'ch\',\'ch_opw\',this.form.opw.value,this.form.npw.value,this.form.npwc.value,this.form.cpwc.value,this.form.email.value)" style="'+sbutton+'"></td></tr>');
	f.write('<tr><td colspan="3">　</td></tr>');
	f.write('<tr><td colspan="3"><font color=ff0000><b>部分郵箱可能會顯示為垃圾郵件,請注意!</b></font></td></tr>');
	f.write('<tr><td colspan="3">　</td></tr>');
	f.write('<tr><td colspan="3" bgcolor="000099">線上回報系統</td></tr>');
	f.write('<tr><td>請注明問題情況,並提供足夠資料,有助管理員協助解決問題!<br>管理員會盡快回復閣下問題,請耐心等待!<br>登入後才可使用此系統!</td><td colspan="2"><textarea name="content" rows="5" cols="50"></textarea></td></tr>');
	f.write('<tr><td colspan="3"><input type="button" value="回報問題" onclick="parent.act_click(\'chara\',\'report\',content.value)" style="'+sbutton+'"></td></tr>');
	f.write('<tr><td colspan="3"><font color=ff0000><b>請勿搗亂或使用不雅文字,請注意!回報內容不可有空白,符號,要分隔內容請使用隔行!</b></font></td></tr>');
	f.write('</form>');
	f.write(temp_table2);
}

//####### 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 data_send(a,b,c,d,e,f)
{
	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;
	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;
	}
	if(f!=null)
	{
	thisfrom.pw.value=f;
	}
	thisfrom.submit();
}

function data_send2(a,b,c,d,e,f,g)
{
	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.pw.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.pw.value=g;
	thisfrom.submit();
}

function foot_trun(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 th_submit(b,s,a)
{
	var thisfrom=b;
	thisfrom.temp_id2.value=s;
	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>0){
		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 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>0){
		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_view()
{
	var f=parent.wog_view.document;
	message_cls();
	f.write('<center><img src="./img/team.gif"></center>');
	f.write(temp_table1);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<tr><td><input type="button" value="隊伍列表" onClick="parent.act_click(\'team\',\'list\')" style="'+sbutton+'"> </td></tr>');
	f.write('<tr><td><input type="button" value="隊員狀態" onClick="parent.act_click(\'team\',\'status\')" style="'+sbutton+'"></td></tr>');
	f.write('<tr><td><input type="button" value="創立隊伍" onClick="parent.team_creat();" style="'+sbutton+'"></td></tr>');
	f.write('<tr><td><input type="button" value="離開隊伍" onClick="parent.act_click(\'team\',\'leave\')" style="'+sbutton+'"></td></tr>');
	f.write('<tr><td><input type="button" value="認領隊員" onClick="parent.act_click(\'team\',\'get_member\')" style="'+sbutton+'"></td></tr>');
	f.write('</form>');
	f.write(temp_table2);

}
function team_list(saletotal,page,s)
{
	var f=parent.wog_view.document;
	message_cls();
	team_head();
	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_table1);
	if(s!="")
	{
		f.write('<tr><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=\'#777779\'" 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[4]+'</td><td>'+s2[1]+'</td><td>'+s2[2]+'</td></tr>');
		}
		var dbsts_join="";
		var dbsts_leave="";
		if(t_team!="")
		{
			dbsts_join="disabled";
		}else
		{
			f.write('<input type="hidden" name="f" value="team"><input type="hidden" name="act" value="join">');
		}
		f.write('<tr><td colspan="5" align="center"><input type="submit" value="加入隊伍"  '+dbsts_join+'  style="'+sbutton+'"></td></tr>');
	}else
	{
		f.write('<tr><td colspan="4" align="center">目前無隊伍</td></tr>');
	}
	f.write(temp_table2);
	f.write('</form>');
}
function team_creat()
{
	var f=parent.wog_view.document;
	message_cls();
	team_head();
	f.write(temp_table1);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<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)" style="'+sbutton+'"> </td></tr>');
	f.write('</form>');
	f.write(temp_table2);
}

function team_status(s,time_line,support,my_id,adm)
{
	var f=parent.wog_view.document;
	message_cls();
	team_head();
	f.write(temp_table1);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write(temp_table1);
	f.write('<tr><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(adm=="0")
			{
				dis2="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 >在線</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 >離線</td></tr>');
			}
		}
		f.write('<tr><td colspan="4" align="center"><input type="button" value="支援隊員" onClick="parent.foot_trun(\'team\',\'support\',null,null,this.form.p_id)"  style="'+sbutton+'"> <input type="button" value="不支援" onClick="parent.act_click(\'team\',\'nosupport\')" style="'+sbutton+'"> <input type="button" value="踢除隊員" onClick="parent.foot_trun(\'team\',\'del\',null,null,this.form.p_id)" '+dis2+' style="'+sbutton+'"></td></tr>');
	}
	f.write('</form>');
	f.write(temp_table2);
}

function team_join_list(s)
{
	var f=parent.wog_view.document;
	message_cls();
	team_head();
	f.write(temp_table1);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<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><input type="radio" name="t_j_id" value="'+s2[0]+'" ></td><td>'+s2[1]+' 提出加入隊伍申請</td><td>'+s2[2]+'</td><td>'+s2[3]+'</td></tr>');
		}
		f.write('<tr><td colspan="4" align="center"><input type="button" value="邀請加入" onClick="parent.foot_trun(\'team\',\'get_save_member\',null,null,this.form.t_j_id)" style="'+sbutton+'"></td></tr>');
	}else
	{
		f.write('<tr><td colspan="5" align="center">沒有玩家申請加入隊伍</td></tr>');	
	}
	f.write('</form>');
	f.write(temp_table2);
}

//##### group  #######
function group_view()
{
	var f=parent.wog_view.document;
	message_cls();
	f.write('<center><img src="./img/group.gif"></center>');
	f.write(temp_table1);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<tr><td><input type="button" value="公會列表" onClick="parent.act_click(\'group\',\'join\')" style="'+sbutton+'"></td><td><input type="button" value="創立公會" onClick="parent.group_creat();" style="'+sbutton+'"></td><td><input type="button" value="會員狀態" onClick="parent.act_click(\'group\',\'p_list\')" style="'+sbutton+'"> </td><td><input type="button" value="領地狀態" onClick="parent.act_click(\'group\',\'center\')" style="'+sbutton+'"></td><td><input type="button" value="匯款動態" onClick="parent.act_click(\'group\',\'mr_view\')" style="'+sbutton+'"></td><td><input type="button" value="會戰狀況" onClick="parent.act_click(\'group\',\'news\')" style="'+sbutton+'"> </td><td><input type="button" value="佈告欄" onClick="parent.act_click(\'group\',\'book\')" style="'+sbutton+'"> </td><td><input type="button" value="招募資訊" onClick="parent.act_click(\'group\',\'ad\')" style="'+sbutton+'"></td><td><input type="button" value="認領會員" onClick="parent.act_click(\'group\',\'get_member\')" style="'+sbutton+'"></td><td><input type="button" value="頭銜授予" onClick="parent.act_click(\'group\',\'set_style_view\')" style="'+sbutton+'"></td><td><input type="button" value="頭銜設定" onClick="parent.act_click(\'group\',\'style\')" style="'+sbutton+'"></td></tr>');
	f.write('</form>');
	f.write(temp_table2);
}
function group_book_view(temp)
{
	var f=parent.wog_view.document;
	message_cls();
	group_head();
	f.write(temp_table1);
	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_table2);
	f.write(hr);
	f.write(temp_table1);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<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)" style="'+sbutton+'"></td></tr>');
	f.write('<tr><td><會長專用></td></tr>');
	f.write('</form>');
	f.write(temp_table2);
}

function group_ad_view(temp) 
{ 
   var f=parent.wog_view.document; 
   message_cls(); 
	group_head();
   f.write(temp_table1); 
   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_table2); 
   f.write(hr); 
   f.write(temp_table1); 
   f.write('<form action="wog_act.php" method="post" target="mission">'); 
   f.write('<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)" style="'+sbutton+'"></td></tr>'); 
   f.write('<tr><td><會長專用></td></tr>'); 
   f.write('</form>'); 
   f.write(temp_table2); 
}

function group_style_view(temp,page) 
{ 
   var view_name=parent.wog_view.document; 
   message_cls(); 
	group_head();
   view_name.write(temp_table1); 
   view_name.write('<form action="wog_act.php" method="post" target="mission">'); 
   if(!page) 
   { 
      view_name.write('<tr><td width=10%>位階排行</td><td width=60%>名稱</td><td width=30%>更改</td></tr>'); 
      var s1=temp.split(";"); 
      for(var a=0;a<10;a++) 
      { 
         if(s1[a]) 
         { 
            s2=s1[a].split(","); 
            view_name.write('<tr><td>'+s2[1]+'</td><td>'+s2[0]+'</td><td><input type="button" value="修改" onClick="parent.act_click(\'group\',\'chang_style\','+s2[1]+')" style="'+sbutton+'"><input type="button" value="刪除" onClick="parent.act_click(\'group\',\'removal_style\','+s2[1]+')" style="'+sbutton+'"></td></tr>'); 
         }else 
         { 
            var b=a+1; 
            view_name.write('<tr><td>'+b+'</td><td>未設定</td><td><input type="button" value="修改" onClick="parent.act_click(\'group\',\'chang_style\','+b+')" style="'+sbutton+'"></td></tr>'); 
         } 
      } 
   }else 
   { 
      view_name.write('<tr><td width=10%>位階排行</td><td width=60%>名稱</td><td width=30%>更改</td></tr>'); 
      s=temp.split(","); 
      view_name.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]+')" style="'+sbutton+'"></td></tr>'); 
      view_name.write('<input type="hidden" name="level" value="'+s[1]+'">'); 
   } 
   view_name.write('</form>'); 
   view_name.write(temp_table2); 
} 
function group_style_set_view(temp,page,player) 
{ 
   var view_name=parent.wog_view.document; 
   message_cls(); 
	group_head();
   view_name.write(temp_table1); 
   view_name.write('<form action="wog_act.php" method="post" target="mission">'); 
   if(!page) 
   { 
      view_name.write('<tr><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="有";} 
         view_name.write('<tr><td><a href=javascript:parent.yesname("'+s2[1]+'") target="foot">'+s2[1]+'</a></td><td>'+p_style+'</td><td><input type="button" value="授與" onClick="parent.act_click(\'group\',\'set_style_chang\','+s2[0]+')" style="'+sbutton+'"><input type="button" value="取消" onClick="parent.act_click(\'group\',\'set_style_removal\','+s2[0]+')" style="'+sbutton+'"></td></tr>'); 
      } 

   }else 
   { 
      view_name.write('<tr><td width=10%>名稱</td><td width=60%>選擇頭銜</td><td width=30%>更改</td></tr>'); 
      view_name.write('<tr><td>'+player+'</td><td><select name="set_style">'); 
      var s1=temp.split(";"); 
      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="";} 
         view_name.write('<option value='+s2[1]+' '+p_check+'>'+s2[0]+'</option>'); 
      } 
      view_name.write('</select></td><td><input type=submit value="修改" style="'+sbutton+'"></td></tr>'); 
      view_name.write('<input type="hidden" name="f" value="group">'); 
      view_name.write('<input type="hidden" name="act" value="set_style_save">'); 
      view_name.write('<input type="hidden" name="p_name" value="'+player+'">'); 
   } 
   view_name.write('</form>'); 
   view_name.write(temp_table2); 
}

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_table1+'<tr><td colspan="2" ><font color="#81D8A8">城堡</font>受到 '+temp_d+' 傷害 </td></tr>');
	f.write(temp_table2);
}
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_table1+'<tr><td colspan="2" >'+f+' 給予 '+d+temp_d+' 傷害 | '+d+' 士氣'+morale+' 兵力'+number+'</td></tr>');
	ff.write(temp_table2);
}
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_table1);
	f.write('<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_table2);
}
function group_join_list(s)
{
	var f=parent.wog_view.document;
	message_cls();
	group_head();
	f.write(temp_table1);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<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><input type="radio" name="g_j_id" value="'+s2[0]+'" ></td><td><a href=javascript:parent.yesname("'+s2[1]+'") target="foot">'+s2[1]+'</a> 提出加入公會申請</td><td>'+s2[4]+'轉'+s2[2]+'級</td><td>'+s2[3]+'</td></tr>');
		}
		f.write('<tr><td colspan="4" align="center"><input type="button" value="邀請加入" onClick="parent.foot_trun(\'group\',\'get_save_member\',null,null,this.form.g_j_id)" style="'+sbutton+'"></td></tr>');
	}else
	{
		f.write('<tr><td colspan="5" align="center">沒有玩家申請加入會員</td></tr>');	
	}
	f.write('</form>');
	f.write(temp_table2);
}

function group_fire_list_peo(s,gs)
{
	var f=parent.wog_view.document;
	message_cls();
	group_head();
	f.write(temp_table1);
	f.write('<form action="wog_fight.php" method="post" target="mission">');
	f.write('<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="戰鼓宣揚~~出擊!!" style="'+sbutton+'"></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_table2);
}

function group_peolist(s,g_name,ad_id)
{
	var f=parent.wog_view.document;
	message_cls();
	group_head();
	f.write(temp_table1);
	f.write('<tr><td colspan="10" bgcolor="000099">'+g_name+'</td></tr>');
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<tr><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 p_name="";
			if(s2[3]==""){s2[3]="0";}
			if(s2[0]==ad_id){
			p_name='<a href=javascript:parent.yesname("'+s2[1]+'") target="foot">'+s2[1]+'</a>(會長)';
			}else{
			p_name='<a href=javascript:parent.yesname("'+s2[1]+'") target="foot">'+s2[1]+'</a>';
			}
			f.write('<tr><td><input type="radio" name="p_id" value="'+s2[0]+'"></td><td>'+p_name+'</td><td>'+s2[2]+'</td><td>'+s2[3]+'</td><td>'+s2[7]+'轉'+s2[4]+'級</td><td>'+s_status(s2[5])+'領</td><td>'+s2[6]+'</td></tr>');
		}
		f.write('<tr><td colspan="10">　</td></tr>');
		f.write('<tr><td colspan="10" bgcolor="000099">變更駐守點</td></tr>');
		f.write('<tr><td colspan="10"><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">毒 <input type="radio" name="g_a_type" value="7">取消駐守</td></tr>');
		f.write('<tr><td colspan="10"><input type="checkbox" name="g_del" value="1">取消會員資格</td></tr>');
		f.write('<tr><td colspan="10"><input type="submit" value="確定" style="'+sbutton+'"><br>只有會長才能改變會員駐守地點以及取消會員資格<br>若會長取消自身的會員資格視同解散公會</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(temp_table2);
}
function group_center(s,g_name,temp_s,fire)
{
	var f=parent.wog_view.document;
	message_cls();
	group_head();
	if(fire==1)
	{
		var yes="checked";
		var no="";
	}else
	{
		var yes="";
		var no="checked";	
	}
	f.write(temp_table1);
	f.write('<tr><td bgcolor="000099">'+g_name+'</td></tr>');
	f.write(temp_table2);
	f.write(hr);
	f.write(temp_table1);
	f.write('<tr><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_table2);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write(temp_table1);
	if(temp_s!="")
	{
		var s1=temp_s.split(",");
		f.write(hr);
		f.write('<tr><td colspan="4">駐守領土--'+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\')" style="'+sbutton+'"><br><input type="button" value="修補城牆" onClick="parent.act_click(\'group\',\'up_hp\')" style="'+sbutton+'"><br><input type="button" value="補充兵力" onClick="parent.act_click(\'group\',\'up_number\',document.forms[0].number.value)" style="'+sbutton+'"><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">提升士氣要2000元</td></tr>');
		f.write('<tr><td colspan="4">修補城牆要從公會倉庫花費20000 元</td></tr>');
		f.write('<tr><td colspan="4">每補充1兵力要10元,多退少補</td></tr>');
	}
	f.write('<tr><td colspan="4"><input type="button" value="貢獻" onClick="parent.act_click(\'group\',\'up_money\',document.forms[0].g_money.value,1)" style="'+sbutton+'"><input type="button" value="提領" onClick="parent.act_click(\'group\',\'up_money\',document.forms[0].g_money.value,2)" style="'+sbutton+'"><input type="text" name="g_money" size="10"> 捐獻或提領公會倉庫金錢</td></tr>');
	f.write('<tr><td colspan="4"><input type="button" value="開戰設定" onClick="parent.foot_trun(\'group\',\'fire_set\',\'\',\'\',document.forms[0].f_set)"> <input type="radio" name="f_set" value="0" '+no+'>關 <input type="radio" name="f_set" value="1" '+yes+'>開 只有會長才能設定</td></tr>');
	f.write(temp_table2);
	f.write('</form>');
}
function group_creat()
{
	var f=parent.wog_view.document;
	message_cls();
	group_head();
	f.write(temp_table1);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<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)" style="'+sbutton+'"> </td></tr>');
	f.write('<tr><td>創立公會需要 十 億元<br>官職等級達到第五級<br>最少 5 次轉生<br>個人分數 100 分</td></tr>');
	f.write('</form>');
	f.write(temp_table2);
}

function group_join(saletotal,page,s) 
{ 
   var f=parent.wog_view.document; 
   message_cls(); 
   f.write('<form action="wog_act.php" method="post" name=pageform target="mission">'); 
   group_head();
   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_table1); 
   f.write('<form action="wog_act.php" method="post" target="mission">'); 
   if(s!="") 
   { 
      f.write('<tr><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(","); 
         var g_ad=""; 
         if(s2[9].length>0) 
         { 
            while(s2[9].indexOf("&n") > 0) 
            { 
               s2[9]=s2[9].replace("&n","\r\n"); 
            } 
            g_ad="<img src='"+img+"info.gif' alt='"+s2[9]+"'>"; 
         }    
         f.write('<tr onMouseOver="this.style.backgroundColor=\'#777779\'" 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[1]+'</td><td >'+s2[2]+'</td><td>'+s2[3]+'</td><td >'+s2[4]+'</td><td>'+s2[6]+' / '+s2[7]+'</td><td>'+s2[5]+'</td><td><a href=javascript:parent.yesname("'+s2[8]+'") target="foot">'+s2[8]+'</a></td><td>'+g_ad+'</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="9" align="center"><input type="submit" value="加入公會"  '+dbsts_join+'  style="'+sbutton+'"> <input type="submit" value="退出公會"  '+dbsts_leave+'  style="'+sbutton+'"></td></tr>'); 
   }else 
   { 
      f.write('<tr><td colspan="9" align="center">目前無公會</td></tr>'); 
   } 
   f.write('</form>'); 
   f.write(temp_table2); 
}
//##### pet #######
function pet_break()
{
	var f=parent.wog_view.document;
	f.write(temp_table1);
	f.write('<tr><td>捕捉器損壞</td></tr>');
	f.write(temp_table2);
}
function pet_get(s)
{
	var f=parent.wog_view.document;
	f.write(temp_table1);
	f.write('<tr><td>捕捉到 '+s+'</td></tr>');
	f.write(temp_table2);
}
function pet_index(name,mname,id,s,pe_list)
{
	var f=parent.wog_view.document;
	message_cls();
	f.write(temp_table1);
	f.write('<form action="wog_act.php" method="post" target="mission" name=f1>');
	f.write('<tr bgcolor="'+tr_bgcolor+'"><td>名稱</td><td>AT</td><td>MT</td><td>DEF</td><td>飽腹</td></tr>');
	var s1=s.split(",");
	f.write('<tr><td >'+name+'-'+mname+'</td><td>'+s1[0]+'</td><td>'+s1[1]+'</td><td>'+s1[2]+'</td><td>'+s1[3]+'</td></tr>');
	f.write('<tr bgcolor="'+tr_bgcolor+'"><td>疲勞</td><td>個性</td><td>年紀</td><td>親密度</td><td>出擊值</td></tr>');
	f.write('<tr><td>'+s1[4]+'</td><td>'+pet_type(s1[5])+'</td><td>'+s1[6]+'</td><td>'+s1[7]+'</td><td>'+s1[8]+'</td></tr>');
	f.write('<tr><td colspan="5">狀態：<input type="radio" name="pe_st" value="0" onclick="parent.foot_trun(\'pet\',\'chg_st\','+id+',0);">攜帶 <input type="radio" name="pe_st" value="2" onclick="parent.foot_trun(\'pet\',\'chg_st\','+id+',2);">獸欄</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_trun(\'pet\',\'ac\','+id+',document.f1.act.value);" style="'+sbutton+'"> <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_trun(\'pet\',\'eat\','+id+',document.f1.act1.value);" style="'+sbutton+'"></td></tr>');
	f.write('<tr><td colspan="5"><input type="text" value="'+name+'" size="20" maxlength="30" name=rename> <input type="button" value="改名" onclick="parent.foot_trun(\'pet\',\'rename\','+id+',document.f1.rename.value);" style="'+sbutton+'"></td></tr>');
	f.write('<tr><td colspan="5"><input type="text" size="15" name=money> <input type="button" value="擺攤" onclick="parent.foot_trun(\'pet\',\'sale\','+id+',document.f1.money.value);" style="'+sbutton+'"></td></tr>');
	f.write('<tr><td colspan="5"><input type="button" value="寵物競技場" onclick="parent.pet_fight();" style="'+sbutton+'"></td></tr>');
	f.write('<tr><td colspan="5">選擇寵物：');
	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="5"><input type="button" value="放生" onclick="parent.pet_leave('+id+');" style="'+sbutton+'"></td></tr>');
	f.write('<input type="hidden" name="pet_id" value="'+id+'">');
	f.write('</form>');
	f.write(temp_table2);
	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_table1);
	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 | 最小賭注 500 最大賭注 5000</td></tr>');
	f.write('<tr><td colspan="5"><input type="submit" value="開始比賽" style="'+sbutton+'"></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_table2);
}

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_table1+'<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_table2);
}

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_table1+'<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_table2);
}

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_table1+'<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_table1+'<tr><td colspan="2" >'+f+s[d]+'</td></tr>');
	ff.write(temp_table2);
}
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_table1+'<tr><td ><b>'+s+' '+enstr+'</b></td></tr>');
	f.write(temp_table2);
}
function pet_leave(id)
{
	if(confirm("確定放生?"))
	{
		foot_trun('pet','leave',id);
	}
}

function pet_detail(at,mt,def,hu,fu,he,fi)
{
	var f=parent.wog_view.document;
	message_cls();
	f.write(temp_table1);
	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_table2);
}

function pet_type(a)
{
	var s=new Array;
	s[0]="";
	s[1]="積極";
	s[2]="冷酷";
	s[3]="鐵壁";
	s[4]="危急";
	return s[a];
}
//###### mission #######
function mission_list(saletotal,page,s,store_id)
{
	var f=parent.wog_view.document;
	message_cls();
	mission_head();
	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="'+store_id+'">');
	f.write('</form>');
	f.write(temp_table1);

	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write(temp_table1);
	f.write('<tr><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=\'#777779\'" 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>'+s2[2]+'</td></tr>');
		}
		f.write('<tr><td colspan="4"><input type="submit" value="接受任務" style="'+sbutton+'"></td></tr>');
		f.write(temp_table2);
		f.write('<input type="hidden" name="f" value="mission">');    
		f.write('<input type="hidden" name="act" value="detail">'); 
	}else
	{
		f.write('<tr><td colspan="4" align="center">目前無任務</td></tr>');
		f.write(temp_table2);
	}
	f.write('</form>');
}

function mission_detail(s,m_id) 
{ 
   message_cls(); 
   mission_head();
   var f=parent.wog_view.document; 
   f.write('<center>'); 
   f.write('<form action="wog_act.php" method="post" target="mission" name=f1>'); 
   if(s!="") 
   { 
      f.write('<div style="padding-left:2em;text-align:center;color:#000000;background-image:url('+missionBackground.src+');background-repeat:no-repeat;background-attachment:fixed;background-position:top center;width:281px;height:340px;">'); 
      var s1=s.split(","); 
      f.write('<div style="padding-top:3.5em;width:100%"><u><b>'+s1[0]+'<b></u></div>'); 
      f.write('<div style="width:80%">委託者：'+s1[1]+'</div>'); 
      var temp=s1[2]; 
      while(temp.indexOf("&n") > 0) 
      { 
         temp=temp.replace("&n","<br>"); 
      } 
      f.write('<div style="text-align:left;padding-top:1em;width:80%;height:180px;overflow=auto">'+temp+'</div>'); 
      f.write('<div style="padding-bottom:2em"><input type="submit" value="確定接受" style="border:none;background:transparent;cursor:hand"></div>'); 
      f.write('</div>'); 
      f.write('<input type="hidden" name="f" value="mission">'); 
      f.write('<input type="hidden" name="act" value="get">'); 
      f.write('<input type="hidden" name="m_id" value="'+m_id+'">'); 
   } 
   f.write('</form>'); 
   f.write('</center>'); 
}

function mission_book(s,m_id) 
{ 
	message_cls(); 
	mission_head(); 
	var f=parent.wog_view.document; 
	m_id=m_id.split(","); 
	var s1=s.split(";"); 
	for(var i=0;i<m_id.length;i++) 
	{ 
		f.write('<form action="wog_act.php" method="post" target="mission" name=f1>'); 
		f.write(temp_table1); 
		var s2=s1[i].split(","); 
		f.write('<tr><td bgcolor="000099">'+s2[0]+'</td></tr>'); 
		f.write('<tr><td>委託者：'+s2[1]+'</td></tr>'); 
		var temp=s2[2]; 
		while(temp.indexOf("&n") > 0) 
		{ 
			temp=temp.replace("&n","<br>"); 
		} 
		f.write('<tr><td class=b1 cellpadding=3>'+temp+'</td></tr>'); 
		f.write('<tr><td>任務所需怪物: '+s2[4]+' / '+s2[3]+'</td></tr>'); 
		f.write('<tr><td><input type="button" value="完成任務" onClick="parent.foot_trun(\'mission\',\'end\',\'\','+m_id[i]+',\'\')" style="'+sbutton+'"> <input type="button" value="放棄任務" onClick="parent.foot_trun(\'mission\',\'break\',\'\','+m_id[i]+',\'\')" style="'+sbutton+'"></td></tr>'); 
		f.write(temp_table2); 
		f.write('</form>'); 
   } 
}
function mission_achieve(a,b)
{
	var f=parent.wog_view.document;
	f.write(hr);
	f.write(temp_table1+'<tr><td ><b>任務要求 '+m_name+' 共'+b+' 隻，現時還有 '+a+' 隻。</b></td></tr>');
	f.write(temp_table2);
}
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_table1+'<tr><td ><b>發現：'+m_name+' ，還有 '+a+' 次</b></td></tr><tr><td class=b1>'+message+'</td></tr>');
	f.write(temp_table2);
}
function mission_paper(saletotal,page,s)
{
	var f=parent.wog_view.document;
	message_cls();
	mission_head();
	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_table1);

	f.write(temp_table1);
	f.write('<tr><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></tr>');
		}
	}else{
			f.write('<tr><td colspan="3">沒有已完成的任務</td></tr>');
	}
	f.write(temp_table2);
}
function mission_ed()
{
	var f=parent.wog_view.document;
	message_cls();
	f.write(temp_table1+'<tr><td><input type="button" value="查看未完成任務" onClick="parent.act_click(\'mission\',\'book\')" style="'+sbutton+'"></td><td> <input type="button" value="查看已完成任務" onClick="parent.act_click(\'mission\',\'paper\')" style="'+sbutton+'"></td></tr>'+temp_table2);
}

//###### event begin ######
function event() 
{ 
	var f=parent.wog_view.document;
	message_cls(); 
	var now_time=new Date();
	f.write(temp_table1); 
	f.write('<form action="wog_act.php" method="post" target="mission">'); 
	f.write('<tr><td>站長要考驗大家是否有認真在玩</td></tr>'); 
	f.write('<tr><td>請注意...必須用半形字 及 數目字 1-9 輸入驗證碼 , 每人有5次機會</td></tr>'); 
	f.write('<tr><td colspan="2"><img src="wog_etc.php?f=confirm&time='+now_time.getTime()+'"></td></tr>'); 
	f.write('<tr><td>請輸入安全驗證碼:<input type="text" name="sec_code" size="8"></td></tr>'); 
	f.write('<tr><td colspan="2"><input class="text" type="button" value="填好答案了,放我過關吧!!" onClick="parent.foot_trun(\'event\',\'\',this.form.sec_code.value,\'\')" style="'+sbutton+'"></td></tr>'); 
	f.write('</form>'); 
	f.write(temp_table2); 
} 

//###### message #######
function message(money,lv)
{
	var f=parent.wog_view.document;
	message_cls();
	f.write(temp_table1);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<tr><td bgcolor="000099" colspan="2">幻想郵局</td></tr>');
	f.write('<tr><td colspan="2">歡迎來到幻想郵局,在這裡玩家可以將訊息傳送給其他玩家,但只允許'+lv+'級以上玩家進行傳訊,每次傳訊送要金錢:'+money+',請輸入正確的對象名稱,亦請勿利用傳訊系統作出洗情報的行為,一經發現,即被停權,多謝合作!</td></tr>');
	f.write('<tr><td>對象帳號</td><td><input type="text" name="name" size="12"></td></tr>');
	f.write('<tr><td>內容</td><td><textarea cols="30" rows="7" name="body"></textarea></td></tr>');
	f.write('<tr><td colspan="2"><input type="button" value="送出" onClick="parent.act_click(\'message\',\'send_message\',this.form.name.value,this.form.body.value)" style="'+sbutton+'"></td></tr>');
	f.write('</form>');
	f.write(temp_table2);
}

//###### 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_table1);
	f.write('<tr><td >'+p_name+'</td><td colspan="4" >現金 '+p_money+' | 賠率 1 : 5 | 最小賭注 100 最大賭注 1000000</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="確定" style="'+sbutton+'"> </td></tr>');
	f.write(temp_table2);
	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_table2);
	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 p1()
{
	parent.peolist.document.location.reload();
	window.setTimeout("p1()",30000); 
}
window.setTimeout("p1()",30000);

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(temp_table1); 
	f.write('<tr><td colspan="6" style="text-align:left">這位歷經百戰的勇士,歡迎來到重生館,如果你達到了<font color=ff0000>'+rebirth_lv+'</font>等級,就可以在這裡進行重生,獲取更強的力量,在幻想戰爭裡進行冒險!不過,首先有幾點需要注意:<br>(一)重生前請脫下所有裝備,否則有機會遺失身上裝備;<br>(二)重生會有十五份之一機會失敗,如不幸失敗,將會扣除現時重生次數乘一千萬的現金,100等級以及各項能力300點;<br>(三)重生所需費用:<font color=ff0000>'+rebirth_money+'</font>元。<br>如果清楚了,請做好心理準備及準備足夠現金,一一點選以下選項,進行重生!</td></tr>');
	f.write(temp_table2);
	f.write('<br>');
	f.write(temp_table1); 
	f.write('<tr><td colspan="6" bgcolor="000099">請重新分配屬性點</td></tr>'); 
	f.write('<tr><td colspan="6">本次重生能力基本值:<font color=ff0000>'+basic+'</font>點 以及自行分配點數:<font color=ff0000>'+total_point+'</font>點</td></tr>'); 
	f.write('<tr><td>力量</td><td>智力</td><td>體力</td><td>敏捷</td></tr>');
	f.write('<tr>'); 
	for(var j=0;j<4;j++) 
	{ 
		f.write('<td><select name='+temp_st[j]+'>'); 
		for(var i=0;i<21;i++) 
		{ 
			f.write('<option value="'+i+'">+'+i); 
		} 
		f.write('</select></td>'); 
	} 
	f.write('</tr>'); 
	f.write(temp_table2);
	f.write('<br>');
	f.write(temp_table1); 
	f.write('<tr><td colspan="6" bgcolor="000099">請重新選擇屬性</td></tr>'); 
	f.write('<tr><td>地</td><td>水</td><td>火</td><td>木</td><td>風</td><td>毒</td></tr>'); 
	f.write('<tr><td><input type="radio" name="s" value="1"></td><td><input type="radio" name="s" value="2"></td><td><input type="radio" name="s" value="3"></td><td><input type="radio" name="s" value="4"></td><td><input type="radio" name="s" value="5"></td><td><input type="radio" name="s" value="6"></td></tr>'); 
	f.write(temp_table2);
	f.write('<br>');
	f.write(temp_table1); 
	f.write('<tr><td colspan="5" bgcolor="000099">請選擇重生地點</td></tr>'); 
	f.write('<tr><td>中央大陸</td><td>魔法王國</td><td>熱帶雨林</td><td>末日王城</td></tr>'); 
	f.write('<tr><td><input type="radio" name="b" value="1"></td><td><input type="radio" name="b" value="2"></td><td><input type="radio" name="b" value="3"></td><td><input type="radio" name="b" value="4"></td></tr>'); 
	f.write(temp_table2);
	f.write('<br>');
	f.write(temp_table1); 
	f.write('<tr><td colspan="5" bgcolor="000099">請重新選擇職系</td></tr>'); 
	f.write('<tr><td>華麗的戰鬥--戰士系</td><td>神秘的魔法--魔師系</td><td>公會戰殺手--盜賊系</td><td>驚人的財力--商人系<td>不死的傳奇--不死系</td></tr>'); 
	f.write('<tr><td><img src=./img/job1.gif></td><td><img src=./img/job2.gif></td><td><img src=./img/job3.gif></td><td><img src=./img/job4.gif></td><td><img src=./img/job5.gif></td></tr>'); 
	f.write('<tr><td><input type="radio" name="ch" value="1"></td><td><input type="radio" name="ch" value="2"></td><td><input type="radio" name="ch" value="3"></td><td><input type="radio" name="ch" value="4"><td><input type="radio" name="ch" value="5"></td></tr>'); 
	f.write(temp_table2);
	f.write('<br>');
	f.write(temp_table1); 
	f.write('<tr><td colspan="5" bgcolor="000099">請確認安全密碼</td></tr>'); 
	f.write('<tr><td><input type="password" name="name" size="20" maxlength="20"></td></tr>'); 
	f.write(temp_table2);
	f.write('<br>');
	f.write(temp_table1);
	f.write('<tr><td><input type="submit" value="我已確認脫下裝備，確定重生" style="'+sbutton+'"></td></tr>'); 
	f.write(temp_table2);
	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]="您已經重獲新生了"; 
	f.write(temp_table1); 
	f.write('<tr><td >'+s[a]+'!!</td></tr>') 
	f.write(temp_table2); 
}

function ch_ch_confirm(ch_ch_money) 
{ 
	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="ch_ch"><INPUT TYPE="hidden" NAME="f" VALUE="ch">');
 	f.write(temp_table1); 
	f.write('<tr><td colspan="5">歡迎光臨幻想戰爭勇者部屋,這裡能夠讓你改變自己的職系,讓你體驗不同職系的快感,不過轉換職系需要付出高昂的代價,請轉職前三思及準備足夠金錢,轉職後,現有的奧義將被卸除!!</font></td></tr>');
	f.write('<tr><td colspan="5"><font color="FF0000">現時轉職手續費:'+ch_ch_money+'元 (300級以下新手免費)</font></td></tr>');
	f.write('<tr><td>華麗的戰鬥--戰士系</td><td>神秘的魔法--魔師系</td><td>公會戰殺手--盜賊系</td><td>驚人的財力--商人系<td>不死的傳奇--不死系</td></tr>'); 
	f.write('<tr><td><img src=./img/job1.gif></td><td><img src=./img/job2.gif></td><td><img src=./img/job3.gif></td><td><img src=./img/job4.gif></td><td><img src=./img/job5.gif></td></tr>'); 
	f.write('<tr><td><input type="radio" name="ch" value="1"></td><td><input type="radio" name="ch" value="2"></td><td><input type="radio" name="ch" value="3"></td><td><input type="radio" name="ch" value="4"><td><input type="radio" name="ch" value="5"></td></tr>'); 
	f.write('<tr><td colspan="5">安全密碼 <input type="password" name="pw" size="20" maxlength="20"></td></tr>');
	f.write('<tr><td colspan="5"><input type="submit" value="確定轉職" style="'+sbutton+'"></td></tr>');
	f.write(temp_table2); 
	f.write('</form>'); 
} 

function ch_grade()
{
	var f=parent.wog_view.document;
	message_cls();
	f.write(temp_table1);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<tr><td><img src="./img/shop/gradep.gif"></td></tr>');
	f.write('<tr><td><font color=red><b>每次轉官職需要100霧靈鬼魂</b></font></td></tr>');
	f.write('<tr><td><img src="./data/dgrade_001.png"></td></tr>');
	f.write('<tr><td><a href="./data/dgrade.html" target="_blank"><b><font color=red>按此查看各級官職需要條件</font></b></td></tr>');
	f.write('<tr><td>請輸入稱號: <input type="text" name="name" size="20" maxlength="20"></td></tr>');
	f.write('<tr><td><input type="button" value="轉官職" onClick="parent.act_click(\'ch\',\'ch_grade\',this.form.name.value)" style="'+sbutton+'"></td></tr>');
	f.write('</form>');
	f.write(temp_table2);
}

function ch_chat()
{
	var f=parent.wog_view.document;
	message_cls();
	f.write(temp_table1);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<tr><td><font color=red><b>請注意下列事項:</b></font></td></tr>');
	f.write('<tr><td><font color=red><b>第一,請先裝備公頻頭銜更改卷</b></font></td></tr>');
	f.write('<tr><td><font color=red><b>第二,請先準備2億現金</b></font></td></tr>');
	f.write('<tr><td><font color=red><b>第三,需要2次轉生</b></font></td></tr>');
	f.write('<tr><td><font color=red><b>第四,需要一定的個人分數</b></font></td></tr>');
	f.write('<tr><td>頭銜 <input type="text" name="name" size="3" maxlength="3"></td></tr>');
	f.write('<tr><td>色碼 <input type="text" name="color" size="6" maxlength="6"></td></tr>');
	f.write('<tr><td><img src="http://wog.we-u.net/img/rgbh.gif"></td></tr>');
	f.write('<tr><td><input type="button" value="轉頭銜" onClick="parent.act_click(\'ch\',\'ch_chat\',this.form.name.value,this.form.color.value)" style="'+sbutton+'"></td></tr>');
	f.write('</form>');
	f.write(temp_table2);
}

function ch_pw()
{
	var f=parent.wog_view.document;
	message_cls();
	f.write(temp_table1);
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write('<tr><td bgcolor=000000><font size=6 color=FF0000>安全密碼設定</font></td></tr>');
	f.write('<tr><td bgcolor=000000>安全密碼 以為了加強 帳號安全 而新推出的措施</td></tr>');
	f.write('<tr><td bgcolor=000000>每人只可設定 <b><font color=ff0000>[[一次]]</font></b> 安全密碼, 一經設定 , 永不更改</td></tr>');
	f.write('<tr><td bgcolor=000000>安全密碼會用於 更改密碼之認證 活動領獎 轉換官職 確認轉生 確認交易 等功能上</td></tr>');
	f.write('<tr><td bgcolor=000000>因此請勿透露 安全密碼 給其他人知道</td></tr>');
	f.write('<tr><td bgcolor=000000>並謹記閣下之安全密碼</td></tr>');
	f.write('<tr><td bgcolor=000000>否則所有損失,幻想戰爭管理團隊 恕不負責</td></tr>');
	f.write('<tr><td bgcolor=000000>　</td></tr>');
	f.write('<tr><td bgcolor=000000>* 玩家之後不可以更改安全密碼</td></tr>');
	f.write('<tr><td bgcolor=000000>　</td></tr>');
	f.write('<tr><td bgcolor=000000>　</td></tr>');
	f.write('<tr><td bgcolor=000000>到此表示閣下已閱完關於安全密碼之守則,以下設定安全密碼</td></tr>');
	f.write('<tr><td bgcolor=000000>此畫面此會出現 <b><font color=ff0000>[[一次]]</font></b></td></tr>');
	f.write('<tr><td bgcolor=000000>請小心輸入 安全密碼</td></tr>');
	f.write('<tr><td bgcolor=000000>安全密碼 限定20字元以內</td></tr>');
	f.write('<tr><td bgcolor=000000>安全密碼 不可與 玩家密碼 或 玩家帳號 一樣</td></tr>');
	f.write('<tr><td bgcolor=000000>　</td></tr>');
	f.write('<tr><td bgcolor=000000>安全密碼 <input type="password" name="name" size="20" maxlength="20"></td></tr>');
	f.write('<tr><td bgcolor=000000>密碼確認 <input type="password" name="name2" size="20" maxlength="20"></td></tr>');
	f.write('<tr><td bgcolor=000000><input type="button" value="確定更改 安全密碼" onClick="parent.act_click(\'ch\',\'ch_pw\',this.form.name.value,this.form.name2.value)" style="'+sbutton+'"></td></tr>');
	f.write('</form>');
	f.write(temp_table2);
}

function ch_luck_confirm(ch_luck_money) 
{ 
	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="ch_luck"><INPUT TYPE="hidden" NAME="f" VALUE="ch">');
	f.write('<p align="center"><font face="新細明體" color="#FF0000"><b>重新設定運氣數值需付'+ch_luck_money+'元!!</b></font></p>');  
	f.write('<p align="center"><font face="新細明體" color="#FF0000"><b>重新設定運氣後可能比現時運氣更低</b></font></p>');  
	f.write('<p align="center"><font face="新細明體" color="#FF0000"><b>下限為1,上限為30,請玩家承受風險</b></font></p>');  
	f.write('</table></p>'); 
	f.write('<tr><td><p align="center">安全密碼 <input type="password" name="pw" size="20" maxlength="20"></p></td></tr>');
	f.write('<p align="center"><input type="submit" value="確定轉運" style="'+sbutton+'"></p>'); 
	f.write('</form>'); 
} 

function draw_confirm(draw_money,draw_sppt) 
{ 
	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="draw"><INPUT TYPE="hidden" NAME="f" VALUE="prize">');
	f.write('<center><img src=./img/box.jpg></center>');
	f.write('<p align=center><font size=5>抽獎需要金錢:'+draw_money+' 及 幻想點數:'+draw_sppt+'</font></p>');
	f.write('</table></p>'); 
	f.write('<tr><td><p align="center">安全密碼 <input type="password" name="pw" size="20" maxlength="20"></p></td></tr>');
	f.write('<p align="center"><input type="submit" value="開始抽獎" style="'+sbutton+'"></p>'); 
	f.write('</form>'); 
} 

function draw_end2(item_name,end) 
{ 
	var f=parent.wog_view.document; 
	message_cls(); 
	f.write(temp_table1+'<tr><td><p align=center>開啟寶箱中...請等待...<BR><font size=7><b>嚓嚓嚓嚓嚓嚓</b></p></font>'); 
	f.write('<center><img src=./img/box.jpg></center>');
	var timerID=setTimeout('draw_end_view2("'+item_name+'","'+end+'")',3000); 
	f.write('</td></tr>'+temp_table2+"<br>"); 
} 
function draw_end_view2(item_name,end) 
{ 
	var f=parent.wog_view.document; 
	message_cls(); 
	f.write(temp_table1+'<tr><td>'); 
	if(end==1)//合成成功 
	{f.write('<p align=center>寶箱開啟了，得到： <font color=#ffffaf size=6>'+item_name+'</font></p> ');} 
	if(end==2)//編號錯誤 
	{f.write('錯誤精鍊，變了一團煙');} 
	if(end==3)//合成失敗 
	{f.write('精鍊失敗，物品消失了');} 
	if(end==4)//裝備過多 
	{f.write('精鍊成功！但因為裝備欄已滿，所以裝備掉下被不明人士撿走，請自認倒楣。');}
	f.write('</td></tr>'+temp_table2); 
} 

function stamp() 
{ 
	var f=parent.wog_view.document; 
	message_cls(); 
	f.write('<form action="wog_act.php" method="post" target="mission">');
	f.write(temp_table1); 
	f.write('<tr><td>');
	f.write('歡迎來到印花屋,大家可以將沒用的裝備換成印花,然後到此換領不同的禮物!每次換領需收取10萬元手續費喔!請在下面選擇閣下想換領的印花數目!');
	f.write('</td></tr>'+temp_table2); 
	f.write('<hr>');
	f.write(temp_table1+'<tr>'); 
	f.write('<td>印花數目</td><td>可換禮物</td>');
	f.write('</tr><tr>');
	f.write('<td><input type="button" value="60個印花" onClick=if(confirm("是否使用60個印花換領禮物?")){parent.act_click(\'ch\',\'stamp\',\'60\')} style="'+sbutton+'"></td>');
	f.write('<td>20%天籟真元(100場)<BR>30%天籟真元(100場)<BR>20格背包<BR>空白卡片<BR>幻想寶箱<BR>幻想礦石<BR>幻想錢袋<BR>鳳凰之翼<BR>月之召喚<BR>飛燕靈魂<BR>500霧靈換領券</td>');
	f.write('</tr><tr>')
	f.write('<td><input type="button" value="150個印花" onClick=if(confirm("是否使用150個印花換領禮物?")){parent.act_click(\'ch\',\'stamp\',\'150\')} style="'+sbutton+'"></td>');
	f.write('<td>20%天籟真元(250場)<BR>30%天籟真元(250場)<BR>幻想2億支票<BR>石頭寶箱<BR></td>');
	f.write('</tr><tr>')
	f.write('<td><input type="button" value="500個印花" onClick=if(confirm("是否使用500個印花換領禮物?")){parent.act_click(\'ch\',\'stamp\',\'500\')} style="'+sbutton+'"></td>');
	f.write('<td>卡片寶箱<BR>20%天籟真元(700場)<BR>炎夏碎片<BR>寒冬碎片</td>');
	f.write('</tr><tr>')
	f.write('<td><input type="button" value="750個印花" onClick=if(confirm("是否使用750個印花換領禮物?")){parent.act_click(\'ch\',\'stamp\',\'750\')} style="'+sbutton+'"></td>');
	f.write('<td>30%天籟真元(700場)<BR>50%天籟真元(700場)<BR>賢臣郭嘉幻想卡<BR>賢臣周瑜幻想卡<BR>關羽幻想卡<BR>孫策幻想卡</td>');
	f.write('</tr><tr>')
	f.write('<td><input type="button" value="2000個印花" onClick=if(confirm("是否使用2000個印花換領禮物?")){parent.act_click(\'ch\',\'stamp\',\'2000\')} style="'+sbutton+'"></td>');
	f.write('<td>潘朵拉的卡片<BR>赫淮斯托斯的卡片<BR>封印的金龍石</td>');
	f.write('</td></tr>'+temp_table2); 
	f.write('</form>');
}
function stamp_end(item_name) 
{ 
	var f=parent.wog_view.document; 
	message_cls(); 
	f.write(temp_table1+'<tr><td>'); 
	f.write('<p align=center>成功換領了 <font color=#ff0000>'+item_name+'</font></p>'); 
	f.write('</td></tr>'+temp_table2); 
} 

function update_exp(lv,exp,nextexp,hp,maxhp)
{
	var f=parent.foot.document; 
	f.getElementById("lv").innerHTML= lv;
	f.getElementById("exppercent").innerHTML= (exp/nextexp*100).toFixed(1)+"%";
	f.getElementById("expwidth").width= exp/nextexp*100;
	f.getElementById("hppercent").innerHTML= (hp/maxhp*100).toFixed(1)+"%";
	f.getElementById("hpwidth").width= hp/maxhp*100;
}

function rbid_view(s,time,money)
{
	message_cls();
	var f=parent.wog_view.document;
	f.write('<form action="wog_act.php" method="post" target="mission" name=f1>');
	f.write(temp_table1);
	f.write('<tr><td class=b1 colspan=11>幻想拍賣會叫價區</td></tr>');
	f.write('<tr><td class=b1 colspan=11>將滑鼠鼠標移到拍賣品名稱上,可以看到物品簡介</td></tr>');
	f.write('<tr><td class=b1 colspan=11>請確保擁有足夠現金/霧靈於截標時讓系統扣除金額,否則會被自動停權</td></tr>');
	
	if(money=="p_money"){money="金錢";}
	if(money=="p_pt"){money="霧靈鬼魂";}
	f.write('<tr><td class=b1 colspan=11>是次拍賣會交易貨幣: <font color=red><b>'+money+'</b></font></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><td>最後出價</td></tr>');
	if(s!="")
	{
		var s1=s.split(";");
		for(var i=0;i<s1.length;i++)
		{
			var s2=s1[i].split(",");
			var open="";
			if(s2[10]==1)
			{s2[10]="不限";}
			if(s2[8]==0)
			{
				open="未開始";
				f.write('<tr bgcolor="CCCCCC" onMouseOver="this.style.backgroundColor=\'#777779\'" onMouseOut="this.style.backgroundColor=\'\'"><td>---</td><td>'+s2[0]+'</td><td><span onmouseover="parent.bidboard_view(event,\''+s2+'\')" onmouseout="parent.bidboard_close()">'+s2[1]+'</span></td><td>'+s2[6]+'</td><td>'+s2[2]+'</td><td>'+s2[10]+'</td><td>'+s2[3]+'</td><td><a href=javascript:parent.yesname("'+s2[5]+'") target="foot"><b>'+s2[5]+'</b></a></td><td>'+s2[4]+'</td><td>'+open+'</td><td>'+s2[7]+'</td></tr>');
			}
			if(s2[8]==1)
			{
				open="競投中";
				f.write('<tr bgcolor="555555" onMouseOver="this.style.backgroundColor=\'#777779\'" 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[0]+'</td><td><span onmouseover="parent.bidboard_view(event,\''+s2+'\')" onmouseout="parent.bidboard_close()">'+s2[1]+'</span></td><td>'+s2[6]+'</td><td>'+s2[2]+'</td><td>'+s2[10]+'</td><td>'+s2[3]+'</td><td><a href=javascript:parent.yesname("'+s2[5]+'") target="foot"><b>'+s2[5]+'</b></a></td><td>'+s2[4]+'</td><td>'+open+'</td><td>'+s2[7]+'</td></tr>');
			}
			if(s2[8]==2)
			{
				open="已完結";
				f.write('<tr bgcolor="000000" onMouseOver="this.style.backgroundColor=\'#777779\'" onMouseOut="this.style.backgroundColor=\'\'"><td>---</td><td>'+s2[0]+'</td><td><span onmouseover="parent.bidboard_view(event,\''+s2+'\')" onmouseout="parent.bidboard_close()">'+s2[1]+'</span></td><td>'+s2[6]+'</td><td>'+s2[2]+'</td><td>'+s2[10]+'</td><td>'+s2[3]+'</td><td><a href=javascript:parent.yesname("'+s2[5]+'") target="foot"><b>'+s2[5]+'</b></a></td><td>'+s2[4]+'</td><td>'+open+'</td><td>'+s2[7]+'</td></tr>');
			}
			if(s2[8]==3)
			{
				open="已完結";
				f.write('<tr bgcolor="000000" onMouseOver="this.style.backgroundColor=\'#777779\'" onMouseOut="this.style.backgroundColor=\'\'"><td>---</td><td>'+s2[0]+'</td><td><span onmouseover="parent.bidboard_view(event,\''+s2+'\')" onmouseout="parent.bidboard_close()">'+s2[1]+'</span></td><td>'+s2[6]+'</td><td>'+s2[2]+'</td><td>'+s2[10]+'</td><td>'+s2[3]+'</td><td><a href=javascript:parent.yesname("'+s2[5]+'") target="foot"><b>'+s2[5]+'</b></a></td><td>'+s2[4]+'</td><td>'+open+'</td><td>'+s2[7]+'</td></tr>');
			}
		}
	}
	f.write('<tr><td colspan="11">叫價 <input type="text" name="price" style="'+sbutton+'"></td></tr>');
	f.write('<tr><td colspan="11">確認安全密碼 <input type="password" name="pw" style="'+sbutton+'" size="20" maxlength="20"></td></tr>');
	f.write('<tr><td colspan="11"><input type="submit" value="確定" style="'+sbutton+'"></td></tr>'); 
	f.write('<tr><td colspan="11"><input type="button" value="更新叫價" style="'+sbutton+'" onclick="parent.act_click(\'rbid\',\'view\')"></td></tr>'); 
	f.write(temp_table2);
	f.write('<INPUT TYPE="hidden" NAME="act" VALUE="rbid">');
	f.write('<INPUT TYPE="hidden" NAME="f" VALUE="rbid">');
	f.write('</form>');
	f.write('<div id="rbidview" name="rbidview" style="display:none;background:black;border:1px solid #4B689E;width:160px;height:160px;position:absolute;left:0px;top:0px"></div>');
}

function board_view(event,ss)
{
	var board=parent.wog_view.itemview;
	var f=parent.wog_view.frameElement;
	Bwidth=parseInt(board.style.width),Bheight=parseInt(board.style.height);
	var s2=ss.split(",");
	if(s2[14]=='') s2[14]='無';
	board.innerHTML='<table border=0 width="100%" style="font-size:9px"><tr><td style="border:1px solid #4B689E"><table border=0 width="100%"><tr><td width="70%" style="text-align:left">'+s2[1]+'</td></tr></table></td></tr><tr><td style="border:1px solid #4B689E"><table border=0 width="100%"><tr><td width="70%" style="text-align:left">裝備能力</td></tr><tr><td>物理攻擊力：'+s2[2]+'<br>魔法攻擊力：'+s2[3]+'<br>物理防禦力：'+s2[4]+'<br>魔法防禦力：'+s2[5]+'<br>速度：'+s2[6]+'</td></tr></table></tr><tr><td style="border:1px solid #4B689E"><table border=0 width="100%"><tr><td width="70%" style="text-align:left">能力限制</td></tr><tr><td>力量：'+s2[7]+'<BR>速度：'+s2[8]+'<BR>智力：'+s2[9]+'<BR>重生：'+s2[17]+'<BR>限定職業：'+s2[14]+' <BR>職業熟練度：'+job_pro(s2[16])+'%</td></tr></table></td></tr></table>';
	board.style.left=event.clientX-Bwidth-20;
	board.style.top=event.clientY-Bheight-50;
	board.style.display="";
}
function board_close()
{
	parent.wog_view.itemview.style.display="none";
}

function armboard_view(event,ss)
{
	var board=parent.wog_view.armview;
	var f=parent.wog_view.frameElement;
	Bwidth=parseInt(board.style.width),Bheight=parseInt(board.style.height); 
	var Bleft=(event.clientX+Math.ceil(Bwidth*5/4)+5 >= f.width)?event.clientX-Math.ceil(Bwidth*5/4):event.clientX+Math.floor(Bwidth/4); 
	var Btop=(event.clientY+Math.ceil(Bheight/2)+5 >= f.height)?event.clientY-Bheight:event.clientY-Math.floor(Bheight/2)+300;
	var s2=ss.split(",");
	if(s2[14]=='') s2[14]='無';
			if(s2[11]!="")
			{
				job=s2[11];
			}else{
				job="無";
			}
	board.innerHTML='<table border=0 width="100%" style="font-size:9px"><tr><td>力量:'+s2[8]+'</td></tr><tr><td>速度:'+s2[9]+'</td></tr><tr><td>智力:'+s2[10]+'</td></tr><tr><td>轉生:'+s2[14]+'</td></tr><tr><td>職業:'+job+'</td></tr></table>';
	board.style.left=Bleft;
	board.style.top=Btop;
	board.style.display="";
}
function armboard_close()
{
	parent.wog_view.armview.style.display="none";
}

function bidboard_view(event,ss)
{
	var board=parent.wog_view.rbidview;
	var f=parent.wog_view.frameElement;
	Bwidth=parseInt(board.style.width),Bheight=parseInt(board.style.height); 
	var maxtop=(f.height<200)?f.height:200;
	var Bleft=(event.clientX+Math.ceil(Bwidth*5/4)+5 >= f.width)?event.clientX-Math.ceil(Bwidth*5/4):event.clientX+Math.floor(Bwidth/4); 
	var Btop=(event.clientY+160 > f.height)?f.height-maxtop:event.clientY-40;
	var s2=ss.split(",");
	board.innerHTML='<table border=0 width="100%" style="font-size:9px"><tr><td style="text-align:left">'+s2[9]+'</td></tr></table>';
	board.style.left=Bleft;
	board.style.top=Btop+parent.wog_view.document.body.scrollTop;
	board.style.display="";
}
function bidboard_close()
{
	parent.wog_view.rbidview.style.display="none";
}

function wog_message_box(a,b,c,d){
	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(",");
			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[4]+' ('+d+')</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[0]+'</td><td>'+s1[1]+'</td></tr>';
			temp_ex+='<tr bgcolor="#4B689E"><td>速度</td><td>職業</td><td>屬性</td><td>建議售價</td></tr>';
			temp_ex+='<tr><td>'+s1[2]+'</td><td>'+s1[10]+'</td><td>'+s_status(s1[15])+'</td><td>'+s1[14]+'</td></tr>';
			temp_ex+='<tr bgcolor="#4B689E"><td>價格</td><td>霧靈</td><td>幻點</td><td>可換印花</td></tr>';
			temp_ex+='<tr><td>'+s1[3]+'</td><td>'+s1[12]+'</td><td>'+s1[13]+'</td><td>'+s1[16]+'</td></tr>';
			temp_ex+='<tr bgcolor="#4B689E"><td colspan="4">能力限制</td></tr>';
			temp_ex+='<tr><td colspan="4">等級:'+s1[17]+' 力:'+s1[7]+' 速:'+s1[8]+' 智:'+s1[9]+' 重生:'+s1[11]+'</td></tr>';
			temp_ex+='</table></td></tr></table>';
			}
			_docHeight=c*25+220;
			_docWidth=(_docWidth/2)-(_width/2);
			var wog_message_box_html='<iframe id="DivShim" src="javascript:false;" scrolling="no" frameborder="0" style="position: absolute; width: '+_width+'; height:'+_height+';left: '+_docWidth+'; top: '+_docHeight+'; Z-INDEX: 99"></iframe>';
			wog_message_box_html+='<table border="0" bgcolor="#555555" cellspacing="0" cellpadding="1" style="position: absolute; width: '+_width+'; height:'+_height+';left: '+_docWidth+'; top: '+_docHeight+'; Z-INDEX: 100">';
		break;
		case 2: //合成大師
			_width=460;
			_height=120;
			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>';
			_docHeight=(_docHeight/3)-(_height/2);
			_docWidth=(_docWidth/2)-(_width/2);
			var wog_message_box_html='<iframe id="DivShim" src="javascript:false;" scrolling="no" frameborder="0" style="position: absolute; width: '+_width+'; height:'+_height+';left: '+_docWidth+'; top: '+_docHeight+'; Z-INDEX: 99"> </iframe>';
			wog_message_box_html+='<table border="0" bgcolor="#555555" cellspacing="0" cellpadding="1" style="position: absolute; width: '+_width+'; height:'+_height+';left: '+_docWidth+'; top: '+_docHeight+'; Z-INDEX: 100">';
		break;
		case 3: //套裝
			var s1=a.split(",");
			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[0]+'套裝</td></tr>';
			temp_ex+='<tr><td colspan="2" bgcolor="#4B689E">武器</td><td colspan="2">'+s1[1]+'</td></tr>';
			temp_ex+='<tr><td colspan="2" bgcolor="#4B689E">身體</td><td colspan="2">'+s1[2]+'</td></tr>';
			temp_ex+='<tr><td colspan="2" bgcolor="#4B689E">頭部</td><td colspan="2">'+s1[3]+'</td></tr>';
			temp_ex+='<tr><td colspan="2" bgcolor="#4B689E">手部</td><td colspan="2">'+s1[4]+'</td></tr>';
			temp_ex+='<tr><td colspan="2" bgcolor="#4B689E">腳部</td><td colspan="2">'+s1[5]+'</td></tr>';
			temp_ex+='<tr><td colspan="2" bgcolor="#4B689E">道具</td><td colspan="2">'+s1[6]+'</td></tr>';
			temp_ex+='<tr><td colspan="2" bgcolor="#4B689E">護符</td><td colspan="2">'+s1[7]+'</td></tr>';
			temp_ex+='<tr><td colspan="2" bgcolor="#4B689E">座騎</td><td colspan="2">'+s1[8]+'</td></tr>';
			temp_ex+='<tr><td colspan="2" bgcolor="#4B689E">幻想卡</td><td colspan="2">'+s1[9]+'</td></tr>';
			temp_ex+='<tr><td colspan="2" bgcolor="#4B689E">幻戰書</td><td colspan="2">'+s1[10]+'</td></tr>';
			temp_ex+='<tr><td colspan="2" bgcolor="#4B689E">守護者</td><td colspan="2">'+s1[11]+'</td></tr>';
			temp_ex+='<tr bgcolor="#4B689E"><td colspan="4">加乘能力</td></tr>';
			temp_ex+='<tr bgcolor="#4B689E"><td>物攻</td><td>魔攻</td><td>物防</td><td>魔防</td></tr>';
			temp_ex+='<tr><td>'+s1[12]+'</td><td>'+s1[13]+'</td><td>'+s1[14]+'</td><td>'+s1[15]+'</td></tr>';
			temp_ex+='<tr bgcolor="#4B689E"><td>速度</td><td>金錢加乘</td><td>經驗加乘</td><td></td></tr>';
			temp_ex+='<tr><td>'+s1[16]+'</td><td>'+Math.floor(s1[18]*100-100)+'%</td><td>'+Math.floor(s1[17]*100-100)+'%</td><td></td></tr>';
			temp_ex+='</table></td></tr></table>';
			}
			_docHeight=c*25+220;
			_docWidth=(_docWidth/2)-(_width/2);
			var wog_message_box_html='<iframe id="DivShim" src="javascript:false;" scrolling="no" frameborder="0" style="position: absolute; width: '+_width+'; height:'+_height+';left: '+_docWidth+'; top: '+_docHeight+'; Z-INDEX: 99"></iframe>';
			wog_message_box_html+='<table border="0" bgcolor="#555555" cellspacing="0" cellpadding="1" style="position: absolute; width: '+_width+'; height:'+_height+';left: '+_docWidth+'; top: '+_docHeight+'; Z-INDEX: 100">';
		break;
	}
	wog_message_box_html+='<tr><td valign="top"><table width=100% border="0"  cellspacing="0" cellpadding="1" >';
	wog_message_box_html+='<tr><td width=90% 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=90% 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>';
	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";
	}
}
