/**
 * @author TONY
**/

var name,sn,src_str,tag_num,remarks_str,intro_str,play_str,operate_str,show_ms,xml_gameinfo,tmp_zc_model,modeltype,tmp_model_arry,tmp_model_arry_num,game_no,trial_game_no,sending_push,submiting_c,loging,tmp_flg;
function showLogin(){
	var registname='motogames';
	
	if (document.domain=='www.motogames.com.cn' || document.domain=='motogames.com.cn'){
		registname='motogames';
	}else if (document.domain=='www.motomusic.com.cn' ||document.domain=='motomusic.com.cn'){
		registname='motomusic';
	}else if (document.domain=='www.motoplus.com.cn'){
		registname='motoplus';
	}	
	makeRequest();
	if (!http_request){
			alert('Giving up :( Cannot create an XMLHTTP instance)');
		}else{
		    //var uid_value = 'userid='+uid;
			var uid_url = 'http://'+document.domain+'/newmg/user_operate/ticket_login.php?fresh='+Math.random();
			http_request.open('GET', uid_url, false);
			//http_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			http_request.send(null);
			http_request = null;
		}
	var login_str = '<form name="lf" onsubmit="return false;"><div id="login"><div id="mobile"><input width="120" name="un" type="text" class="input_01" title="手机号" maxlength="11"/></div><div id="mobile_04"><input width="90" name="pwd" type="password" class="input_04" title="密码" /></div><div id="login_btn"><input type=image src="http://www.motogames.com.cn/images/login_01.gif" border=0 class="img_01" onclick="javascript:asynSubmit(\'login\')"/><a href=javascript:; onClick="window.open(\'http://join.motorola.com.cn/member/registration2.html?campaign='+registname+'\',\'_blank\',\'width=670,height=400,Scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no,resizable=no\');"><img src="http://www.motogames.com.cn/images/login_02.gif" class="img_01" border="0" /></a></div><div id="login_text"><a href="javascript:;" class="font_01" onclick="javascript:forgetNum();"><img src="http://www.motogames.com.cn/images/login_03.gif" class="img_01" border="0" /></a></div></div></form>';
	var all_info = getCookie("_ALL_INFO");
	var uid = getCookie('USERID');
	name = String(getCookie('NUMBER'));
	if(all_info!='' && name!='' && uid!=''){
		makeRequest();
		if (!http_request){
			alert('Giving up :( Cannot create an XMLHTTP instance)');
		}else{
			/*tmp_rand = parseInt(10*Math.random());
			uid += tmp_rand;
			http_request.open("GET","http://www.motogames.com.cn/newmg/interface/check_out.php?userid="+uid,false);
			http_request.send(null);*/
			var uid_value = 'userid='+uid;
			var uid_url = 'http://'+document.domain+'/newmg/interface/check_out.php?'+uid_value;
			http_request.open('POST', uid_url, false);
			http_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			http_request.send(uid_value);
			var rtnResult = http_request.responseText;
			http_request = null;
			if(rtnResult==0){
				login_str = '<div id="login_text1">您好<a class="fonts13">'+name+'</a> 欢迎光临MOTO站!&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://www.motogames.com.cn/newmg/user_operate/update_info1.php" class="fonts13" target="_blank">修改个人资料</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:;" onclick="javascript:asynSubmit(\'logout\')" class="fonts13">重新登录</a></div>';
			}else{
				var expire_date=new Date();
				expire_date.setTime(expire_date.getTime());
				var expire_string=expire_date.toGMTString();
				if(sn==0){
					document.cookie='_ALL_INFO="";expires=0;path=/;';
					document.cookie='USERID="";expires=0;path=/;';
					document.cookie='NUMBER="";expires=0;path=/;';
				}else{
					document.cookie='_ALL_INFO=null;expires=0;path=/;domain="www.motogames.com.cn";secure';
					document.cookie='USERID=null;expires=0;path=/;domain="www.motogames.com.cn";secure';
					document.cookie='NUMBER=null;expires=0;path=/;domain="www.motogames.com.cn";secure';
				}
				location.reload();
			}
		}
	}
	document.getElementById('login1').innerHTML += login_str;
	showIframe();
}

function showsearch(){
	var image_game='http://www.motogames.com.cn/images/main_music17.jpg';
	var image_music='http://www.motogames.com.cn/images/main_music18.jpg';
	var image_soft='http://www.motogames.com.cn/images/main_music19.jpg';
	var display_game='<div id="imgc_con_3" style="display:none">';
	var display_music='<div id="imgc_con_4" style="display:none">';
	var display_soft='<div id="imgc_con_5" style="display:none">';
	var music_index='http://'+document.domain+'/motomusic/music/index.php';
	if (document.domain=='www.motogames.com.cn' || document.domain=='motogames.com.cn'){
		image_game='http://www.motogames.com.cn/images/main_music17_a.jpg';
		display_game='<div id="imgc_con_3">';
		registname='motogames';
	}else if (document.domain=='www.motomusic.com.cn' ||document.domain=='motomusic.com.cn'){
		image_music='http://www.motogames.com.cn/images/main_music18_a.jpg';
		display_music='<div id="imgc_con_4">';
	}else if (document.domain=='www.motoplus.com.cn'){
		image_soft='http://www.motogames.com.cn/images/main_music19_a.jpg';
		display_soft='<div id="imgc_con_5">';
	}
	var search_str='	   <table width="251" border="0" cellspacing="0" cellpadding="0"><tr> <td width="251" height="237" align="left" valign="top" background="http://www.motogames.com.cn/images/search_1.gif"><table width="186" border="0" cellspacing="0" cellpadding="0" class="tab_1"><tr><td><div onmouseover="SetLbl(\'imgc\',\'imgd\',3);"><img src="'+image_game+'" width="61" height="39"  name="imgc3" id="imgc3" /></a></div></td><td><div onmouseover="SetLbl(\'imgc\',\'imgd\',4);"><img src="'+image_music+'" width="63" height="39" name="imgc4" id="imgc4" /></a></div></td>       <td><div onmouseover="SetLbl(\'imgc\',\'imgd\',5);"><img src="'+image_soft+'" width="62" height="39" id="imgc5" /></a></div></td>     </tr>     <tr>         <td colspan="3"> '+display_game+'<table width="100%" border="0" cellspacing="0" cellpadding="0"> 			<form id="mysearch" name="mysearch" method="post" action="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php" target="_blank" onsubmit="return checkSearch();">        <tr>    <td width="82" height="28" class="font_1">按机型搜索：</td>			     <td width="56%"><label><select name="umodel"  class="select_1" id="umodel" onfocus="showModel(\'umodel\')">         <option value="0" selected="selected">选择机型</option>         </select></label>           </td>      </tr>         <tr>      <td colspan="2"><span class="font_1">关键字搜索：</span><a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=17&tname=动作">动作</a>  <a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=17&tname=角色">角色</a>  <a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=17&tname=体育">体育</a>  <a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=17&tname=休闲">休闲</a>  <a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=17&tname=精品">精品</a>  <a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=17&tname=大众">大众</a>  <a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=17&tname=促销">促销</a>  <a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=17&tname=包月">包月</a></td>         </tr>       <tr>      <td class="font_1">游戏名检索：</td>       <td><label>      <input name="sname" type="text" class="input_1" id="sname" title="游戏名"/>         </label></td>       </tr>       <tr>             <td>&nbsp;</td>            <td height="40" align="right" valign="middle"><input type=image src="http://www.motogames.com.cn/images/search_2.jpg" border=0 class="img_1" width="64" height="21" value="submit"/><!--img src="http://www.motogames.com.cn/images/search_2.jpg" width="64" height="21" class="img_1" /--></td>           </tr>           </form>		</table>     </div>      '+display_music+'<table width="100%" border="0" cellspacing="0" cellpadding="0"> <form id="mysearch_music" name="mysearch_music" method="post" action="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Search" target="_blank" ><tr>    <td width="82" height="28" class="font_1">搜索分类：</td>			     <td width="56%"><label><select name="selectmusic"  class="select_1" id="selectmusic" ><option value="0" selected="selected">歌曲</option><option value="0" selected="selected">歌手</option></select></label>           </td>      </tr><tr><td colspan="2"><span class="font_1">关键字搜索：</span><a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Songkey&songkey=流行MP3">流行MP3</a>  <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Songkey&songkey=经典怀旧">经典怀旧</a>  <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Songkey&songkey=网络当红">网络当红</a>  <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Songkey&songkey=影视游戏">影视金曲</a>  <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Songkey&songkey=原创搞笑">原创搞笑</a> </td></tr>       <tr>      <td class="font_1">名称检索：</td>       <td><label>      <input name="search" type="text" class="input_1" id="search"/>         </label></td>       </tr>       <tr>             <td>&nbsp;</td>            <td height="40" align="right" valign="middle"><input type=image src="http://www.motogames.com.cn/images/search_2.jpg" border=0 class="img_1" width="64" height="21" value="submit"/><!--img src="http://www.motogames.com.cn/images/search_2.jpg" width="64" height="21" class="img_1" /--></td>           </tr>           </form></table>        </div>   '+display_soft+'<table width="100%" border="0" cellspacing="0" cellpadding="0">			  <form id="mysearch_soft" name="mysearch_soft" method="post" action="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php" target="_blank" onsubmit="return checkSearch_soft();">        <tr>        <td width="82" height="28" class="font_1">按机型搜索：</td>			            <td width="56%"><label><select name="umodel_soft"  class="select_1" id="umodel_soft" onfocus="showModel(\'umodel_soft\')">              <option value="0" selected="selected">选择机型</option>             </select></label>         </td>         </tr>         <tr>           <td colspan="2"><span class="font_1">关键字搜索：</span><a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=298&tname=搜索">搜索</a> 			<a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=300&tname=聊天">聊天</a>				<a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=299&tname=通信">通信</a> 				<a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=106&tname=飞行">飞行</a> 				<a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=301&tname=工具">工具</a>				<a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=57&tname=数独">数独</a> 								<a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=309&tname=旅行">旅行</a> 				<a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=308&tname=读书">读书</a> 				<a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=307&tname=点评">点评</a> 				<a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=306&tname=浏览">浏览</a> 				<a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=305&tname=资讯">资讯</a> 				<a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=303&tname=新闻">新闻</a> 				<a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=302&tname=订票">订票</a> 				<a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=310&tname=预定">预定</a> 				</td>                </tr>              <tr>                <td class="font_1">软件名检索：</td>                <td><label>                  <input name="sname" type="text" class="input_1" id="sname" title="软件名"/>                </label></td>              </tr>              <tr>                <td>&nbsp;</td>                <td height="40" align="right" valign="middle"><input type=image src="http://www.motogames.com.cn/images/search_2.jpg" border=0 class="img_1" width="64" height="21" value="submit"/></td>              </tr>              </form>			</table>			</div>            </td>            </tr>			</table></td>            </tr>          </table>';
	document.getElementById('searchdiv').innerHTML = search_str;
}

function showtag(){
	var image_game='http://www.motogames.com.cn/images/main_music20.jpg';
	var image_music='http://www.motogames.com.cn/images/main_music21.jpg';
	var image_soft='http://www.motogames.com.cn/images/main_music22.jpg';
	var display_game='<div id="imgi_con_13" style="display:none">';
	var display_music='<div id="imgi_con_14" style="display:none">';
	var display_soft='<div id="imgi_con_15" style="display:none">';
	if (document.domain=='www.motogames.com.cn' || document.domain=='motogames.com.cn'){
		image_game='http://www.motogames.com.cn/images/main_music20_a.jpg';
		display_game='<div id="imgi_con_13">';
	}else if (document.domain=='www.motomusic.com.cn' ||document.domain=='motomusic.com.cn'){
		image_music='http://www.motogames.com.cn/images/main_music21_a.jpg';
		display_music='<div id="imgi_con_14">';
	}else if (document.domain=='www.motoplus.com.cn'){
		image_soft='http://www.motogames.com.cn/images/main_music22_a.jpg';
		display_soft='<div id="imgi_con_15">';
	}
	var music_index='http://'+document.domain+'/motomusic/music/index.php';
	var tag_str='<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tab_2"><tr><td height="207" align="left" valign="top" background="http://www.motogames.com.cn/images/tag_1.gif"><table width="186" border="0" cellspacing="0" cellpadding="0" class="tab_3"><tr><td>&nbsp;</td><td>&nbsp;</td><td height="22"></td></tr><tr><td><div onmouseover="SetLbl(\'imgi\',\'imgj\',13);"><img src="'+image_game+'" width="61" height="45" name="imgi13" id="imgi13" /></div></td><td><div onmouseover="SetLbl(\'imgi\',\'imgj\',14);"><img src="'+image_music+'" width="63" height="45" name="imgi14" id="imgi14"/></div></td><td><div onmouseover="SetLbl(\'imgi\',\'imgj\',15);"><img src="'+image_soft+'" width="62" height="45" id="imgi15"/></div></td></tr><tr> <td colspan="3">'+display_game+'<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=3&tname=动作">动作</a> <a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=39&tname=射击">射击</a> <a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=17&tname=角色">角色</a> <a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=56&tname=益智">益智</a> <a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=52&tname=冒险">冒险</a> <a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=5&tname=休闲">休闲</a> <a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=145&tname=牌类">牌类</a> <a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=63&tname=赛车">赛车</a> <a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=168&tname=足球">足球</a> <a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=122&tname=体育">体育</a> <a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=288&tname=迪士尼">迪士尼</a> <a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=42&tname=战机">战机</a> <a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=283&tname=三国">三国</a> <a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=206&tname=篮球">篮球</a></td></tr></table></div>'+display_music+'<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Songkey&songkey=流行MP3">流行MP3</a>  <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Songkey&songkey=经典怀旧">经典怀旧</a>  <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Songkey&songkey=网络当红">网络当红</a>  <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Songkey&songkey=影视游戏">影视金曲</a>  <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Songkey&songkey=原创搞笑">原创搞笑</a> </td></tr><tr><td><span class="font_1">歌手名查询: </span><a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Tag&tag=A">A</a> <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Tag&tag=B">B</a> <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Tag&tag=C">C</a> <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Tag&tag=D">D</a> <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Tag&tag=E">E</a> <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Tag&tag=F">F</a> <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Tag&tag=G">G</a> <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Tag&tag=H">H</a> <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Tag&tag=I">I</a> <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Tag&tag=J">J</a> <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Tag&tag=K">K</a> <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Tag&tag=L">L</a> <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Tag&tag=M">M</a> <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Tag&tag=N">N</a> <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Tag&tag=O">O</a> <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Tag&tag=P">P</a> <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Tag&tag=Q">Q</a> <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Tag&tag=R">R</a> <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Tag&tag=S">S</a> <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Tag&tag=T">T</a> <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Tag&tag=U">U</a> <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Tag&tag=V">V</a> <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Tag&tag=W">W</a> <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Tag&tag=X">X</a> <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Tag&tag=Y">Y</a> <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Tag&tag=Z">Z</a> <a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Tag&tag=NU">NU</a></td></tr></table></div>'+display_soft+'<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=298&tname=搜索">搜索</a> <a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=300&tname=聊天">聊天</a> <a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=299&tname=通信">通信</a> <a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=106&tname=飞行">飞行</a> <a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=301&tname=工具">工具</a> <a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=57&tname=数独">数独</a> <a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=309&tname=旅行">旅行</a> <a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=308&tname=读书">读书</a> <a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=307&tname=点评">点评</a> <a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=306&tname=浏览">浏览</a> <a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=305&tname=资讯">资讯</a> <a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=303&tname=新闻">新闻</a> <a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=302&tname=订票">订票</a> <a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=310&tname=预定">预定</a> </td></tr></table></div></td></tr></table></td></tr></table>';
	document.getElementById('tagdiv').innerHTML = tag_str;
}

function shownav(){
	var music_index='http://'+document.domain+'/motomusic/music/index.php';
	var nav_str='<table width="922" border="0" cellpadding="0" cellspacing="0"><tr><td width="80" valign="top">&nbsp;</td><td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td><div><a href="http://www.motogames.com.cn/index.html"><img src="http://www.motogames.com.cn/images/m_01.gif" name="imga0" width="95" height="38" border="0" id="imga0" /></a></div></td><td><div onmouseover="SetLbl(\'imge\',\'imgf\',6);"><a href="http://www.motogames.com.cn/main_games.html"><img src="http://www.motogames.com.cn/images/m_02.gif" name="imga1" width="120" height="38" border="0" id="imge6" /></a></div></td><td><div onmouseover="SetLbl(\'imge\',\'imgf\',7);"><a href="http://www.motomusic.com.cn/motomusic/music/index.php"><img src="http://www.motogames.com.cn/images/m_03.gif" name="imge7" width="120" height="38" border="0" id="imge7" /></a></div></td><td><div onmouseover="SetLbl(\'imge\',\'imgf\',8);"><a href="http://www.motoplus.com.cn/main_soft.html"><img src="http://www.motogames.com.cn/images/m_04.gif" name="imge8" width="121" height="38" border="0" id="imge8" /></a></div></td><td><div><a href="'+music_index+'?controller=Others&action=Equipment"><img src="http://www.motogames.com.cn/images/m_05.gif" width="95" height="38" border="0" id="imga4" /></a></div></td><td><div><a href="'+music_index+'?controller=News&action=List"><img src="http://www.motogames.com.cn/images/m_06.gif" name="imga5" width="96" height="38" border="0" id="imga5" /></a></div></td><td><div><a href="'+music_index+'?controller=Others&action=Wap"><img src="http://www.motogames.com.cn/images/m_07.gif" name="imga6" width="109" height="38" border="0" id="imga6" /></a></div></td><td><div><a href="'+music_index+'?controller=Others&action=Problem"><img src="http://www.motogames.com.cn/images/m_08.gif" name="imga7" width="96" height="38" border="0" id="imga7" /></a></div></td></tr></table><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td height="20"><div id="imge_con_6" style="display:none"><table width="760" border="0" cellspacing="0" cellpadding="0"><tr><td height="20" align="left"style="padding-top:2px;margin-left:30px;"><a href="http://www.motogames.com.cn/main_games_top.html">排行榜</a>　<a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=3&tname=动作">动作类游戏</a>　<a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=39&tname=射击">射击类游戏</a>　<a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=17&tname=角色">角色类游戏</a>　<a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=56&tname=益智">益智类游戏</a>　<a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=52&tname=冒险">冒险类游戏</a>　<a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid=5&tname=休闲">休闲类游戏</a>　</td></tr></table></div><div id="imge_con_7" style="display:none"><table width="550" border="0" cellspacing="0" cellpadding="0"><tr><td height="20" align="center" style="padding-top:2px;"><a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Singerlist" >找歌星</a>　<a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Musictop">MOTO飚榜</a>　<a href="http://www.motomusic.com.cn/motomusic/music/index.php?controller=Music&action=Mv">MV及视频</a>　</td></tr></table></div><div id="imge_con_8" style="display:none"><table width="760" border="0" cellspacing="0" cellpadding="0"><tr><td height="20" align="center" style="padding-top:2px">                  	<a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=298&tname=搜索">搜索类软件</a>　<a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=300&tname=聊天">聊天类软件</a>　<a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=299&tname=通信">通信类软件</a>　<a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=106&tname=飞行">飞行类软件</a>　<a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=301&tname=工具">工具类软件</a>　<a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=309&tname=旅行">旅行类软件</a>　<a href="http://www.motoplus.com.cn/newmg/user_operate/newmysearch_soft.php?tid=305&tname=资讯">资讯类软件</a>　</td></tr></table></div> </td></tr></table></td></tr></table>';
	document.getElementById('navdiv').innerHTML = nav_str;
}

function showTag(tnum){
	if(document.getElementById('q_body')!=null){
		tag_num = tnum;
		makeRequest();
		var tag_url = 'http://'+document.domain+'/newmg/xml/tag.xml';
		http_request.onreadystatechange = ajaxTag;
		http_request.open('GET', tag_url, true);
		http_request.send(null);
	}
}

function ajaxTag(){
	if (http_request.readyState == 4){
		if (http_request.status == 200){
			var xml_doc = http_request.responseXML;
			http_request = null;
			if(!xml_doc){
				createMessageDiv('There was a problem with the XML,Please change IE5.0!',1,10000,400,90,'red',0,90);
				return false;
			}
			var tag_values = xml_doc.getElementsByTagName('Message')[0].childNodes;
			if(tag_num<=0) tag_num = tag_values.length;
			var tag_name;
			var tag_str = '';
			for(var i=0;i<tag_num;i++){
				tag_name = tag_values[i].childNodes[0].data;
				tag_str += '<a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?tid='+tag_values[i].getAttribute('id')+'&tname='+tag_values[i].childNodes[0].data+'" class="f_'+tag_values[i].getAttribute('fz')+'" target="_blank">'+tag_name+'</a>';
			}
			if(tag_str!='') document.getElementById('q_body').innerHTML = tag_str;
		}else{
			createMessageDiv('There was a problem with the Tag request,Please reload!',1,10000,400,90,'red',0,90);
		}
	}
}

function showModel(idname){
	if (idname=='umodel')
	{
		var tmp_id=document.mysearch.umodel.options.length;
		tmp_flg=0;
	}else{
		var tmp_id=document.mysearch_soft.umodel_soft.options.length;
		tmp_flg=1;
	}
	if(tmp_id<=1){
		makeRequest();
		var model_url = 'http://'+document.domain+'/newmg/xml/phone_model.xml';
		http_request.onreadystatechange = ajaxModel;
		http_request.open('GET', model_url, true);
		http_request.send(null);
	}
}

function ajaxModel(){
	if (http_request.readyState == 4){
		if (http_request.status == 200){
			closeMessageDiv();
			var xml_doc = http_request.responseXML;
			http_request = null;
			if(!xml_doc){
				createMessageDiv('There was a problem with the XML,Please change IE5.0!',1,10000,400,90,'red',0,90);
				return false;
			}
			var model_values = xml_doc.getElementsByTagName('Message')[0].childNodes;
			model_num = model_values.length;
			for(var i=0;i<model_num;i++){
				if (tmp_flg==0)
				{
					document.mysearch.umodel.options.add(new Option(model_values[i].getAttribute('name').replace('A1200','明'),model_values[i].getAttribute('name')));
				}else{
					document.mysearch_soft.umodel_soft.options.add(new Option(model_values[i].getAttribute('name').replace('A1200','明'),model_values[i].getAttribute('name')));
				}
			}
		}else{
			createMessageDiv('There was a problem with the Model request,Please reload!',1,10000,400,90,'red',0,90);
		}
	}else{
		createMessageDiv('数据读取中!',0,0,185,75,0,0,90);
	}
}

/*function showIframe(){
	var all_info = getCookie("_ALL_INFO");
	var src_str = 'http://www.weberliu.com/store_embed.php?style=game';
	var eq_div = document.getElementById('equipment');
	if(eq_div!=null){
		if(all_info!=''){
			makeRequest();
			if (!http_request){
				alert('Giving up :( Cannot create an XMLHTTP instance)');
			}else{
				var tmp_rand = parseInt(10*Math.random());
				http_request.open("GET","http://www.motogames.com.cn/newmg/interface/iframe_out.php?"+tmp_rand,false);
				http_request.send(null);
				var rtnResult = http_request.responseText;
				http_request = null;
				if(rtnResult!=0) src_str += '&'+rtnResult;
			}
		}
		eq_div.innerHTML = '<iframe id="iframe" src="'+src_str+'" frameborder="0" width="645"  height="1024"  allowtransparency="yes" scrolling="auto" />';
	}
}*/

function showIframe(){
	var all_info = getCookie("_ALL_INFO");
	var eq_div = document.getElementById('equipment');
	src_str = 'http://www.motostore.com.cn/store_embed.php?style=game';
	if(eq_div!=null){
		if(all_info!=''){
			makeRequest();
			//var tmp_rand = parseInt(10*Math.random());
			//var iframe_url = 'http://www.motogames.com.cn/newmg/interface/iframe_out.php?'+tmp_rand;
			var iframe_url = 'http://'+document.domain+'/newmg/interface/iframe_out.php';
			eq_div.innerHTML = '';
			http_request.onreadystatechange = ajaxIframe;
			http_request.open('POST', iframe_url, true);
			http_request.send(null);
		}else{
			eq_div.innerHTML = '<iframe id="iframe" src="'+src_str+'" frameborder="0" width="660"  height="840"  allowtransparency="yes" scrolling="auto" />';
		}
	}
}

function ajaxIframe(){
	if (http_request.readyState == 4){
		if (http_request.status == 200){
			var eq_div = document.getElementById('equipment');
			var rtnResult = http_request.responseText;
			http_request = null;
			if(rtnResult!=0) src_str += '&'+rtnResult;
			eq_div.innerHTML = '<iframe id="iframe" src="'+src_str+'" frameborder="0" width="660"  height="840"  allowtransparency="yes" scrolling="auto" />';
		}else{
			createMessageDiv('There was a problem with the iframe request,Please reload!',1,10000,400,90,'red',0,90);
		}
	}else{
		var load_str = '<div class="imgno"><img src="/images/loading.gif" align="absmiddle" width="188" height="32" border="0" class="imgno"/></div>';
		document.getElementById('equipment').innerHTML = load_str;
	}
}

function forgetNum(){
	var fs = '<form name="fs" onsubmit="return false;"><div id="mobile_01">手机:</div><input name="fsun" type="text" class="input_03" title="手机号" /><br><input type=image src="http://www.motogames.com.cn/images/submit.gif" border=0 onclick="javascript:findNum()" align="center" /></form>';
	createMessageDiv(fs,0,0,250,100,0,0,90);
}

function findNum(){
	var fsun = document.fs.fsun.value;
	if(fsun==''){
		alert('手机号不能为空!');
	}else{
		if(/^1\d{10}$/g.test(fsun)){
			closeMessageDiv();
			makeRequest();
			var find_value = 'pn='+fsun;
			var find_url = 'http://'+document.domain+'/newmg/user_operate/find_pwd1.php';
			http_request.open('POST', find_url, true);
			http_request.onreadystatechange = findResult;
			http_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			http_request.send(find_value);
			/*closeMessageDiv();
			var fs = '<img src="/images/loading.gif" align="absmiddle" width="188" height="32" border="0"  class="imgno"/>';
			if (!http_request){
				alert('Giving up :( Cannot create an XMLHTTP instance)');
			}else{
				createMessageDiv(fs,0,0,200,90,0,0);
				var tmp_rand = parseInt(10*Math.random());
				http_request.open("GET","http://www.motogames.com.cn/newmg/user_operate/find_pwd.php?"+tmp_rand+"&pn="+fsun,false);
				http_request.send(null);
				var rtnResult = http_request.responseText;
				http_request = null;
				alert(rtnResult)
				closeMessageDiv();
				if(rtnResult==1)
					createMessageDiv('您的密码已经发送成功!',1,2000,365,90,0,0);
				else
					createMessageDiv('对不起，超出今日发送次数!',1,2000,365,90,'red',0);
			}*/
		}else{
			alert('手机号不正确!');
		}
	}
}

function findResult(){
	if (http_request.readyState == 4){
		if (http_request.status == 200){
			closeMessageDiv();
			var rtnResult = http_request.responseText;
			http_request = null;
			if(rtnResult==1)
				createMessageDiv('您的密码已经发送成功!',1,2000,365,90,0,0,90);
			else if(rtnResult==2)
				createMessageDiv('对不起，密码下发失败!',1,2000,365,90,'red',0,90);
			else if(rtnResult==3)
				createMessageDiv('对不起，您还未<a href="javascript:;" onClick="window.open(\'http://join.motorola.com.cn/member/registration2.html?campaign=motogames\',\'_blank\',\'width=850,height=800,Scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no,resizable=no\');" class="font_01">注册!</a>',1,5000,365,90,'red',0,90);
			else
				createMessageDiv('对不起，超出今日发送次数!',1,2000,365,90,'red',0,90);
		}else{
			alert('There was a problem with the find request.');
		}
	}else{
		var fs = '<div class="imgno"><img src="/images/loading.gif" align="absmiddle" width="188" height="32" border="0"  class="imgno"/></div>';
		createMessageDiv(fs,0,0,200,90,0,0,90);
	}
}

function loginSubmit(){
	if(loging){
		alert('正在为您登录!');
		return false;
	}
	if(sending_push){
		alert('正在为您下发PUSH!');
		return false;
	}
	if(submiting_c){
		alert('正在为您提交信息!');
		return false;
	}
	if(name==''){
		var unum = document.lf.un.value;
		var upwd = document.lf.pwd.value;
		if(unum=='' || upwd==''){
			createMessageDiv('对不起,用户名或密码不能为空!',1,2000,365,90,'red',0,90);
			return false;
		}else{
			if(/^1\d{10}$/g.test(unum)){
				document.getElementById('login1').innerHTML = '';
				loging = true;
				makeRequest();
				var login_value = 'unum='+unum+'&upwd='+upwd+'&login=index';
				var login_url = 'http://'+document.domain+'/newmg/user_operate/login2.php';
				http_request.open('POST', login_url, true);
				http_request.onreadystatechange = loginResult;
				http_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
				http_request.send(login_value);
			}else{
				createMessageDiv('对不起,手机号不正确!',1,2000,365,90,'red',0,90);
			}
		}
	}
}

function loginResult(){
	var load_str;
	if (http_request.readyState == 4){
		loging = false;
		if (http_request.status == 200){
			document.getElementById('login1').innerHTML = '';
			load_str = String(getCookie('NUMBER'));
			if(load_str=='') createMessageDiv('对不起,登录失败!',1,2000,365,90,'red',0,90);
			http_request = null;
			showLogin();
		}else{
			createMessageDiv('There was a problem with the login request,Please reload!',1,10000,400,90,'red',0,90);
		}
	}else{
		load_str = '<div class="imgno"><img src="/images/loading.gif" align="absmiddle" width="188" height="32" border="0" /></div>';
		document.getElementById('login1').innerHTML = load_str;
	}
}

function logOutSubmit(){
	if(loging){
		alert('正在为您登录!');
		return false;
	}
	if(sending_push){
		alert('正在为您下发PUSH!');
		return false;
	}
	if(submiting_c){
		alert('正在为您提交信息!');
		return false;
	}
	if(name!=''){
		document.getElementById('login1').innerHTML = '';
		loging = true;
		makeRequest();
		//var tmp_rand = parseInt(10*Math.random());
		//var logout_url = 'http://www.motogames.com.cn/newmg/user_operate/logout.php?'+tmp_rand;
		var logout_url = 'http://'+document.domain+'/newmg/user_operate/logout1.php';
		http_request.open('POST', logout_url, true);
		http_request.onreadystatechange = logOutResult;
		http_request.send(null);
	}
}

function logOutResult(){
	var load_str;
	if (http_request.readyState == 4){
		loging = false;
		if (http_request.status == 200){
			document.getElementById('login1').innerHTML = '';
			//load_str = String(getCookie('NUMBER'));
			//if(load_str!='') alert('对不起,退出失败');
			http_request = null;
			showLogin();
			location.reload();
		}else{
			createMessageDiv('There was a problem with the logout request,Please reload!',1,10000,400,90,'red',0,90);
		}
	}else{
		load_str = '<div class="imgno"><img src="/images/loading.gif" align="absmiddle" width="188" height="32" border="0" /></div>';
		document.getElementById('login1').innerHTML = load_str;
	}
}

function showGameInfo(){
	var fn = getFileName();
	if(fn!=''){
		makeRequest();
		var info_url = 'http://'+document.domain+'/newmg/xml/gamesinfo/'+fn+'.xml';
		http_request.onreadystatechange = ajaxGameInfo;
		http_request.open('GET', info_url, true);
		http_request.send(null);
	}else{
		window.close();
	}
}

function ajaxGameInfo(){
	if (http_request.readyState == 4){
		if (http_request.status == 200){
			xml_gameinfo = http_request.responseXML;
			http_request = null;
			if(!xml_gameinfo){
				createMessageDiv('There was a problem with the XML,Please change IE5.0!',1,10000,400,90,'red',0,90);
				return false;
			}

			document.title = xml_gameinfo.getElementsByTagName('name')[0].childNodes[0].data+'-'+document.title;
			var cg_value = xml_gameinfo.getElementsByTagName('cgname')[0].childNodes;
			var gamesname="游戏";
			with(cg_value[0]){
				if(data=='动作冒险')
					cg = 1;
				else if(data=='角色扮演')
					cg = 2;
				else if(data=='体育竞技')
					cg = 3;
				else if(data=='棋牌休闲')
					cg = 4;
				else if(data=='网络游戏')
					cg = 5;
				else if(data=='应用软件'){
					cg = 9;
					gamesname="软件";
				}
			}
			var score = xml_gameinfo.getElementsByTagName('score')[0].childNodes[0].data;
			if(score!='' && score<30){
				ystar = 1;
				gstar = 4;
			}else if(score>=30 && score<60){
				ystar = 2;
				gstar = 3;
			}else if(score>=60 && score<80){
				ystar = 3;
				gstar = 2;
			}else if(score>=80 && score<90){
				ystar = 4;
				gstar = 1;
			}else{
				ystar = 5;
				gstar = 0;
			}
			var star_str = '';
			for(i=0;i<ystar;i++) star_str += '<img src="http://www.motogames.com.cn/newmg/img/star_yellow.gif"/>';
			for(i=0;i<gstar;i++) star_str += '<img src="http://www.motogames.com.cn/newmg/img/star_gray.gif"/>';
			
			intro_str = xml_gameinfo.getElementsByTagName('gameintro')[0].childNodes[0].data;
			remarks_str = analysisXml('remarks',xml_gameinfo);
			var all_message_str = analysisXml('gameplay',xml_gameinfo);
			operate_str = '';
			play_str = '';
			if(all_message_str){
				var zz=/\|/;
				if(zz.exec(all_message_str)){
					operate_str = RegExp.leftContext;
					play_str = RegExp.rightContext;
				}else{
					operate_str = all_message_str;
				}
			}
			var cut_str = '';
			for(i=1;i<5;i++) cut_str += '<div class="game_cut"><img src="'+xml_gameinfo.getElementsByTagName('imgsrc')[0].childNodes[0].data+i+'.'+xml_gameinfo.getElementsByTagName('imgtype')[0].childNodes[0].data+'" width="128" height="128" /></div>';
			modeltype = xml_gameinfo.getElementsByTagName('isphonesort')[0].childNodes[0];
			var zc_model = '支持大类机型(点击机型查看所包含的机型)：';
			var zc_model_num = xml_gameinfo.getElementsByTagName('modelnum')[0].childNodes[0].data;
			var tag_mod_num = '';
			tmp_zc_model = '';
			for(i=0;i<zc_model_num;i++){
				tag_mod_num = 'model'+i;
				if(modeltype && modeltype.data==0){
					tmp_zc_model += xml_gameinfo.getElementsByTagName(tag_mod_num)[0].childNodes[0].data+'|';
					zc_model += xml_gameinfo.getElementsByTagName(tag_mod_num)[0].childNodes[0].data+' | ';
				}else if(modeltype && modeltype.data==1){
					tmp_zc_model += xml_gameinfo.getElementsByTagName(tag_mod_num)[0].childNodes[0].data+'|';
					zc_model += '<a href="javascript:;" onclick="showAllModel(\''+xml_gameinfo.getElementsByTagName(tag_mod_num)[0].childNodes[0].data+'\')">'+xml_gameinfo.getElementsByTagName(tag_mod_num)[0].childNodes[0].data+'</a> | ';
				}
			}
			if(modeltype && modeltype.data==0) zc_model = zc_model.replace('大类机型(点击机型查看所包含的机型)','机型');
			if(xml_gameinfo.getElementsByTagName('gameNo')[0].childNodes[0]){
				game_no = xml_gameinfo.getElementsByTagName('gameNo')[0].childNodes[0].data;
				//document.getElementById('gamedown').style.display = "block";
				//document.getElementById('gamedown').innerHTML = '<img src="http://www.motogames.com.cn/images/mobile2.gif" />';
			}
			if(xml_gameinfo.getElementsByTagName('trialgameNo')[0].childNodes[0]){
				trial_game_no = xml_gameinfo.getElementsByTagName('trialgameNo')[0].childNodes[0].data;
				document.getElementById('trialgamedown').style.display = "block";
				document.getElementById('trialgamedown').innerHTML = '<img src="http://www.motogames.com.cn/images/mobile1.gif" />';
			}
			if(xml_gameinfo.getElementsByTagName('rardown')[0].childNodes[0].data==1){
				rar_url = xml_gameinfo.getElementsByTagName('rarurl')[0].childNodes[0].data;
				document.getElementById('rardown').style.display = "block";
				document.getElementById('rardown').innerHTML = '<img src="http://www.motogames.com.cn/images/PC.gif" />';
			}
			
			document.getElementById('imgdiv').innerHTML = '<img src="'+xml_gameinfo.getElementsByTagName('imgsrc')[0].childNodes[0].data+'0.'+xml_gameinfo.getElementsByTagName('imgtype')[0].childNodes[0].data+'" border="1" width="120" height="120"/><br/>[<a href="http://www.motogames.com.cn/newmg/user_operate/newmysearch.php?typeid='+cg+'" target="_blank">'+cg_value[0].data+'</a>]';
			document.getElementById('namediv').innerHTML = gamesname+'名称：'+xml_gameinfo.getElementsByTagName('name')[0].childNodes[0].data+'<br/>推荐指数：'+star_str+'<br/>收费价格：'+xml_gameinfo.getElementsByTagName('gameprice')[0].childNodes[0].data+'元';
			document.getElementById('messagetext').innerHTML = intro_str;
			document.getElementById('imgcut').innerHTML = cut_str;
			document.getElementById('showmodel').innerHTML = zc_model;
			document.getElementById('mzspname').innerHTML = xml_gameinfo.getElementsByTagName('spname')[0].childNodes[0].data;
			document.getElementById('mzgamename').innerHTML = xml_gameinfo.getElementsByTagName('name')[0].childNodes[0].data;
			document.getElementById('mzgameprice').innerHTML = xml_gameinfo.getElementsByTagName('gameprice')[0].childNodes[0].data;
			document.getElementById('mzpricetype').innerHTML = '元';
			document.getElementById('mzspphone').innerHTML = xml_gameinfo.getElementsByTagName('spphone')[0].childNodes[0].data;
			showComment();
		}else{
			createMessageDiv('There was a problem with the GameInfo request,Please reload!',1,10000,400,90,'red',0,90);
		}
	}
}

function showAllModel(modelsort){
	if(modelsort){
		show_ms = modelsort;
		makeRequest();
		var ms_url = 'http://'+document.domain+'/newmg/xml/phone_model.xml';
		http_request.onreadystatechange = ajaxSallmodel;
		http_request.open('GET', ms_url, true);
		http_request.send(null);
	}
}

function ajaxSallmodel(){
	if (http_request.readyState == 4){
		if (http_request.status == 200){
			document.getElementById('allmodel').innerHTML = '';
			var xml_doc = http_request.responseXML;
			http_request = null;
			if(!xml_doc){
				createMessageDiv('There was a problem with the XML,Please change IE5.0!',1,10000,400,90,'red',0,90);
				return false;
			}
			var ms_value = xml_doc.getElementsByTagName('Message')[0].childNodes;
			var ms_num = ms_value.length;
			var ps_id = '';
			for(i=0;i<ms_num;i++){
				if(ms_value[i].getAttribute('name')==show_ms) ps_id = ms_value[i].getAttribute('psid');
			}
			if(ps_id){
				var am_str = '';
				for(i=0;i<ms_num;i++){
					if(ms_value[i].getAttribute('psid')==ps_id) am_str += ms_value[i].getAttribute('name')+' | ';
				}
				am_str = am_str.replace('A1200','明');
				document.getElementById('allmodel').style.display = "block";
				document.getElementById('allmodel').innerHTML = show_ms+'包含机型:&nbsp;'+am_str;
			}
		}else{
			createMessageDiv('There was a problem with the model request,Please reload!',1,10000,400,90,'red',0,90);
		}
	}else{
		var load_str = '<div class="imgno"><img src="/images/loading.gif" align="absmiddle" width="188" height="32" border="0" /></div>';
		document.getElementById('allmodel').innerHTML = load_str;
	}
}

function sendPushModel(ptyep){
	if(ptyep && document.sgp.sgpmode.options.length<=1){
		if(ptyep==1 && tmp_zc_model){
			tmp_model_arry = tmp_zc_model.split('|');
			tmp_model_arry_num = tmp_model_arry.length;
			if(modeltype && modeltype.data==0){
				for(i=0;i<tmp_model_arry_num;i++){
					if(tmp_model_arry[i]) document.sgp.sgpmode.options.add(new Option(tmp_model_arry[i].replace('A1200','明'),tmp_model_arry[i]));
				}
			}else if(modeltype && modeltype.data==1){
				setPushModel();
			}
		}else if(ptyep==2){
			var tmodeltype = xml_gameinfo.getElementsByTagName('istphonesort')[0].childNodes[0];
			if(tmodeltype){
				tmp_model_arry_num = xml_gameinfo.getElementsByTagName('tmodelnum')[0].childNodes[0].data;
				var tag_mod_num = '';
				var tmname = '';
				for(i=0;i<tmp_model_arry_num;i++){
					tag_mod_num = 'tmodel'+i;
					if(tmodeltype.data==0){
						tmname = xml_gameinfo.getElementsByTagName(tag_mod_num)[0].childNodes[0].data;
						document.sgp.sgpmode.options.add(new Option(tmname.replace('A1200','明'),tmname));
					}else if(tmodeltype.data==1){
						tmname += xml_gameinfo.getElementsByTagName(tag_mod_num)[0].childNodes[0].data+'|';
					}
				}
				if(tmname.indexOf('|')>0){
					tmp_model_arry = tmname.split('|');
					setPushModel();
				}
			}
		}
	}
}

function setPushModel(){
	if(tmp_model_arry && tmp_model_arry_num){
		makeRequest();
		var spm_url = 'http://'+document.domain+'/newmg/xml/phone_model.xml';
		http_request.onreadystatechange = setPmodel;
		http_request.open('GET', spm_url, true);
		http_request.send(null);
	}
}

function setPmodel(){
	if (http_request.readyState == 4){
		if (http_request.status == 200){
			var xml_doc = http_request.responseXML;
			http_request = null;
			if(!xml_doc){
				createMessageDiv('There was a problem with the XML,Please change IE5.0!',1,10000,400,90,'red',0,90);
				return false;
			}
			var ms_value = xml_doc.getElementsByTagName('Message')[0].childNodes;
			var ms_num = ms_value.length;
			var ps_id = '';
			for(i=0;i<tmp_model_arry_num;i++){
				for(j=0;j<ms_num;j++){
					if(ms_value[j].getAttribute('name')==tmp_model_arry[i]){
						ps_id = ms_value[j].getAttribute('psid');
						for(k=0;k<ms_num;k++){
							if(ms_value[k].getAttribute('psid')==ps_id) document.sgp.sgpmode.options.add(new Option(ms_value[k].getAttribute('name').replace('A1200','明'),ms_value[k].getAttribute('name')));
						}
					}
				}
			}
		}else{
			createMessageDiv('There was a problem with the model request,Please reload!',1,10000,400,90,'red',0,90);
		}
	}
}

function sendGamePush(t_g){
	if(loging){
		alert('正在为您登录!');
		return false;
	}
	if(sending_push){
		alert('正在为您下发PUSH!');
		return false;
	}
	if(submiting_c){
		alert('正在为您提交信息!');
		return false;
	}
	var sppn = document.sgp.pn.value;
	var sppm = document.sgp.sgpmode.value;
	var spvc = document.sgp.valicode.value;
	if(sppn!='' && sppm!=0 && spvc!='' && spvc==getCookie('img_md5_code').substr(0,4)){
		if(/^1\d{10}$/g.test(sppn)){
			if(t_g==1 && !getCookie('NUMBER')){
				createMessageDiv('对不起，您还没有登录!',1,2000,365,90,'red',0,90);
				return false;
			}
			//'&name='+xml_gameinfo.getElementsByTagName('name')[0].childNodes[0].data+
			var push_value = 'sppn='+sppn+'&sppm='+sppm+'&spvc='+spvc+'&sp='+xml_gameinfo.getElementsByTagName('spename')[0].childNodes[0].data+'&gameid='+xml_gameinfo.getElementsByTagName('gid')[0].childNodes[0].data;
			if(t_g==0 && game_no){
				push_value += '&id='+game_no+'&trial='+t_g;
			}else if(t_g==1 && trial_game_no){
				push_value += '&id='+trial_game_no+'&trial='+t_g;
			}else{
				createMessageDiv('游戏编号不正确!',1,2000,365,90,'red',0,90);
				push_value = '';
				return false;
			}
			if(push_value!=''){
				sending_push = true;
				makeRequest();
				var push_url = 'http://'+document.domain+'/newmg/user_operate/send_push.php';
				http_request.open('POST', push_url, true);
				http_request.onreadystatechange = pushResult;
				http_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
				http_request.send(push_value);
			}
		}else{
			createMessageDiv('手机号不正确!',1,2000,365,90,'red',0,90);
		}
	}else{
		createMessageDiv('手机号、手机型号、验证码不能为空,或验证码不正确!',1,2000,365,90,'red',0,90);
	}
}

function pushResult(){
	if (http_request.readyState == 4){
		sending_push = false;
		if (http_request.status == 200){
			closeMessageDiv();
			var rtnResult = http_request.responseText;
			http_request = null;
			if(rtnResult=='ok'){
				createMessageDiv('游戏PUSH下发成功!',1,2000,365,90,0,0,90);
				setTimeout("location.reload();",2000);
			}else if(rtnResult==1){
				createMessageDiv('对不起，您没有登录!',1,2000,365,90,'red',0,90);
			}else if(rtnResult==2){
				createMessageDiv('对不起，验证码输入不正确!',1,2000,365,90,'red',0,90);
			}else if(rtnResult==3){
				createMessageDiv('对不起，手机号不正确!',1,2000,365,90,'red',0,90);
			}else if(rtnResult==4){
				createMessageDiv('对不起，有空值!',1,2000,365,90,'red',0,90);
			}else if(rtnResult==5){
				createMessageDiv('对不起，PUSH下载失败!',1,2000,365,90,'red',0,90);
			}else{
				createMessageDiv('对不起，超出今日发送次数!',1,2000,365,90,'red',0,90);
			}
		}else{
			createMessageDiv('There was a problem with the sendPush request,Please reload!',1,10000,400,90,'red',0,90);
		}
	}else{
		var fs = '<div class="imgno"><img src="/images/loading.gif" align="absmiddle" width="188" height="32" border="0"  class="imgno"/></div>';
		createMessageDiv(fs,0,0,200,90,0,0,90);
	}
}

function submitComment(){
	if(loging){
		alert('正在为您登录!');
		return false;
	}
	if(sending_push){
		alert('正在为您下发PUSH!');
		return false;
	}
	if(submiting_c){
		alert('正在为您提交信息!');
		return false;
	}
	var sc = document.comment.content.value;
	if(sc=='' || sc.getByteLength()>150){
		createMessageDiv('对不起，您没有评论内容或内容超过150个字!',1,2000,365,90,'red',0,90);
	}else{
		var comment_value = 'commentid='+getFileName();
		if(getCookie('NUMBER')) comment_value += '&phonenum='+getCookie('NUMBER');
		comment_value += '&content='+sc;
		if(document.comment.show.checked) comment_value += '&showphone='+document.comment.show.value;
		submiting_c = true;
		makeRequest();
		var submit_url = 'http://'+document.domain+'/newmg/user_operate/submit.php';
		http_request.open('POST', submit_url, true);
		http_request.onreadystatechange = submitResult;
		http_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		http_request.send(comment_value);
	}
}

function submitResult(){
	if (http_request.readyState == 4){
		submiting_c = false;
		if (http_request.status == 200){
			closeMessageDiv();
			var rtnResult = http_request.responseText;
			http_request = null;
			if(rtnResult=='ok'){
				createMessageDiv('评论提交成功!',1,2000,365,90,0,0,90);
				document.comment.content.value = '';
				showComment();
			}else if(rtnResult==1){
				createMessageDiv('对不起，有空值!',1,2000,365,90,'red',0,90);
			}else if(rtnResult==2){
				createMessageDiv('对不起，评论内容中有屏蔽字符!',1,2000,365,90,'red',0,90);
			}else if(rtnResult==3){
				createMessageDiv('对不起，该IP地址被禁止发表评论!',1,2000,365,90,'red',0,90);
			}else if(rtnResult==4){
				createMessageDiv('对不起，文件生成失败!',1,2000,365,90,'red',0,90);
			}else{
				createMessageDiv('对不起，评论提交失败!',1,2000,365,90,'red',0,90);
			}
		}else{
			createMessageDiv('There was a problem with the sendPush request,Please reload!',1,10000,400,90,'red',0,90);
		}
	}else{
		var fs = '<div class="imgno"><img src="/images/loading.gif" align="absmiddle" width="188" height="32" border="0"/></div>';
		createMessageDiv(fs,0,0,200,90,0,0,90);
	}
}

function showComment(){
	makeRequest();
	if (!http_request){
		alert('Giving up :( Cannot create an XMLHTTP instance)');
	}else{
		var tmp_rand = parseInt(100*Math.random());
		var fnid = getFileName();
		http_request.open("GET","http://"+document.domain+"/newmg/xml/gamessubmit/"+fnid+".xml?"+tmp_rand,false);
		http_request.send(null);
		var xml_doc = http_request.responseXML;
		http_request = null;
		if(!xml_doc){
			createMessageDiv('There was a problem with the XML,Please change IE5.0!',1,10000,400,90,'red',0,90);
			return false;
		}
		var comment_obj = xml_doc.getElementsByTagName('Message')[0];
		if(comment_obj){
			//document.getElementById('showsubcontent').innerHTML = '<div class="comment1_over">&nbsp;&nbsp;游戏任你评：('+xml_doc.getElementsByTagName('Total')[0].childNodes[0].data+')&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.motogames.com.cn/newmg/user_operate/show_more.php?commentid='+ fnid+'" target="_blank">更多评论</a></div>';
			document.getElementById('showsubcontent').innerHTML = '<div class="comment1_over">&nbsp;&nbsp;游戏任你评：('+xml_doc.getElementsByTagName('Total')[0].childNodes[0].data+')</div>';
			var comment_value = comment_obj.childNodes;
			var comment_num = comment_value.length;
			var content,cu,ct,temp;
			for(var i=1;i<comment_num;i++){
				content = comment_value[i].childNodes[0].data;
				temp = content;
				content = content.replace(/\r/g,'<br />').replace(/\n/g,'<br />');
				if(content.length>17) temp = temp.substr(0,17)+'...';
				cu = comment_value[i].getAttribute('cu');
				ct = comment_value[i].getAttribute('ct');
				document.getElementById('showsubcontent').innerHTML += '<div class="comment1" onmouseover="this.className=\'comment1_over\'" onmouseout="this.className=\'comment1_out\'">'+i+'、<a href="javascript:;" onclick="ajaxShowComment(\''+cu+'\',\''+ct+'\',\''+content+'\')" class="font_12" title="点击这里察看完整留言!">'+temp+'</a></div>';
			}
		}else{
			document.getElementById('showsubcontent').innerHTML = '暂无评论';
		}
	}
}

function ajaxShowComment(contuser,conttime,content){
	var asc = '<div class="asc_title">'+conttime+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+contuser+'</div><div class="asc_content">'+content+'</div>';
	createMessageDiv(asc,0,0,400,'auto',0,0,90);
}
document.write("<script   language=\"javascript\"   src=\"tagging_Game.js\"></script>");