//Modified by LM 02-9-25 15:02
//改变函数名称，防止与sohu、netease的广告冲突。

function tomgetuser(src)
{
	var I = src.substr(src.indexOf("?tomuserid=") + 11).length;
	
	if (0 >= I) return -1;
	if (I == src.length) return -1;
	return src.substr(src.indexOf("?tomuserid=") + 11,src.indexOf("&tomusername=") - src.indexOf("?tomuserid=") - 11);
}

function tomgetuname(src)
{
	var I = src.substr(src.indexOf("&tomusername=") + 13).length;
	var T = src.indexOf("&tomusername=");
	if (0 >= T) return "";
	if (I == src.length) return -1;
	return src.substr(src.indexOf("&tomusername=") + 13);
}

function tomgourl(urls, Height, Width)
{
	var I,i;

	for (i=0;i<document.scripts.length;i++)
	{
		if (null != document.scripts[i].src)	
		{
			I = tomgetuser(document.scripts[i].src);
			if (0 < I)
			{
				break;
			}	
		}
	}
	
	if (0 >= I)
	{
		window.open(urls,'','height=' + Height + ' ,width=' + Width + ',resizable=no,location=yes');
	}
	else
	{
		urls= urls + "&user_id=" + I;
		window.open(urls,'','height=' + Height + ' ,width=' + Width + ',resizable=no,location=yes');
	}

}

function tomgo(urls)
{
	var I,i;

	for (i=0;i<document.scripts.length;i++)
	{
		if (null != document.scripts[i].src)	
		{
			I = tomgetuser(document.scripts[i].src);
			if (0 < I)
			{
				break;
			}	
		}
	}
	
	if (0 >= I)
	{
		window.open(urls);
	}
	else
	{
		urls= urls + "&user_id=" + I;
		window.open(urls);
	}

}

function tomgologin(urls, Height, Width)
{
	var I,i;

	for (i=0;i<document.scripts.length;i++)
	{
		if (null != document.scripts[i].src)	
		{
			I = tomgetuname(document.scripts[i].src);
			if (0 < I.length)
			{
				break;
			}	
		}
	}

	urls= urls + "?up_line=" + I;
	open(urls,'','height=' + Height + ' ,width=' + Width + ',location=yes,scrollbars=yes');
}

function tom_sms_goto(order,inc,type,cata,page)
{
	var bt="",special_flag=1;
	var I,i;

	for (i=0;i<document.scripts.length;i++)
	{
		if (null != document.scripts[i].src)	
		{
			I = tomgetuser(document.scripts[i].src);
			if (0 < I)
			{
				break;
			}	
		}
	}
	
	if ((type==45)||(type==46)||(type==39)||(type==43)||(type==44)||(type==41)||(type==42)||(type==52)||(type==53)||(type==54)||(type==55)||(type==56)){bt="color_pic";};
	if ((type==47)||(type==40)||(type==50)||(type==51)||(type==57)||(type==59)){bt="hexuan";};
	if ((type==51)||(type==55)||(type==56)||(type==54)||(type==53)){special_flag=2;};
	urls="sms_" + order + "_" + inc + "_" + type + "_" + cata + "_" + page + ".htm?user_id="+I + "&bt=" +bt+'&special_flag='+special_flag;
	fu_urls="http://www.thethirdmedia.com/sms/smse.aspx/usmsPacaPac/smslist/list"+order+"/"+urls;
	open(fu_urls,'_blank','');
}

function sms_send1(inc,type,id,key)           
{
	var bt="",special_flag=1;
	var I,i;

	for (i=0;i<document.scripts.length;i++)
	{
		if (null != document.scripts[i].src)	
		{
			I = tomgetuser(document.scripts[i].src);
			if (0 < I)
			{
				break;
			}	
		}
	}
	
	var bt="",pf="u_lingsheng_step0",special_flag=0;
	if ((type==45)||(type==46)||(type==39)||(type==43)||(type==44)||(type==41)||(type==42)||(type==52)||(type==53)||(type==54)||(type==55)||(type==56)){bt="color_pic";special_flag=1;};
	if ((type==47)||(type==40)||(type==50)||(type==51)||(type==57)||(type==59)){bt="hexuan";special_flag=1;};
	if ((type==51)||(type==55)||(type==56)||(type==54)||(type==53)){special_flag=2;};

	if (inc==1){pf="v7n_yanyu_step0";};
	if (inc==2){pf="v7n_tupian_step0";};
	if (inc==3){pf="v7n_lingsheng_step0";};
	window.open('http://www.thethirdmedia.com/sms/smse.aspx/usendPacaPac/'+pf+'.php?inc='+inc+'&type='+type+'&id='+id+'&user_id='+I+'&var='+key+'&bt='+bt+'&special_flag='+special_flag,'','height=310,width=430,resizable=no');
	
}
function go_search()
{
	var I,i;

	for (i=0;i<document.scripts.length;i++)
	{
		if (null != document.scripts[i].src)	
		{
			I = tomgetuser(document.scripts[i].src);
			if (0 < I)
			{
				break;
			}	
		}
	}
	//document.URL="http://www.thethirdmedia.com/sms/smse.aspx/usmsPacaPac/smslist/smsearch.php?user_id=" + I +"&keyword=" + search.keyword.value + "&inc=" + search.inc.value   ;
	urls="http://www.thethirdmedia.com/sms/smse.aspx/mysmsPacaPac/smslist/smsearch.php?user_id=" + I +"&keyword=" + search.keyword.value + "&inc=" + search.inc.value   ;
	window.open(urls);
	return false;
}
function show_mysms()
{
	var I,i;

	for (i=0;i<document.scripts.length;i++)
	{
		if (null != document.scripts[i].src)	
		{
			I = tomgetuser(document.scripts[i].src);
			if (0 < I)
			{
				break;
			}	
		}
	}
	window.open("http://www.thethirdmedia.com/sms/smse.aspx/mysmsPacaPac/smslist/show_mysms.php?user_id="+I,null,"");
}
function game_subscribe(inc,type,id,z)//Added by Tom.LM 02-9-22 23:08
{
	//alert(z) ;
	var I,i;

	for (i=0;i<document.scripts.length;i++)
	{
		if (null != document.scripts[i].src)	
		{
			I = tomgetuser(document.scripts[i].src);
			if (0 < I)
			{
				break;
			}	
		}
	}
	
	if(z=='3')
	{
		p_name="vgirl_subscribe_new" ;
	}else{
	
		if ((z=='1')||(z=='2'))
		{
			p_name="wxqy_gif_list_txt_75" ;
			//p_name="wxqy_subscribe" ;
		}else{
		
			p_name="wxqy_gif_list_txt_75" ;
		}	
	}
	window.open('http://www.thethirdmedia.com/sms/smse.aspx/usmsPacaPac/'+p_name+'.php?inc='+inc+'&type='+type+'&id='+id+'&user_id='+I+'&code_id=99',''+p_name+'','height=300,width=300,resizable=no,location=no');
}


