var a=0;
var b=0;
var c=0;
var d=0;

function check_grade()
{
	if(frm_grade.grade.value==""||frm_grade.grade1.value==""||frm_grade.grade2.value==""||frm_grade.grade3.value=="")
	{
		document.getElementById("tips").innerHTML="请先选择您的评分！";
		return false;
	}
	if(frm_grade.grade_memo.value=="")
	{
		document.getElementById("tips").innerHTML="请输入点评内容!";
		return false;
	}
	if(frm_grade.grade_memo.value.length<20)
	{
		document.getElementById("tips").innerHTML="点评字数过短，至少20个字!";
		return false;
	}	
	frm_grade.action="/operate/script/gradeadd";
	frm_grade.submit();
}

function check_grade1()
{
	if(frm_grade.grade.value==""||frm_grade.grade1.value==""||frm_grade.grade2.value==""||frm_grade.grade3.value=="")
	{
		document.getElementById("tip").innerHTML="请先选择您的评分！";
		return false;
	}
}

function gradeona(obj)
{
	var objid=obj.id;
	var i;
	var num=objid.substr(1,1);
	for(i=1;i<=num;i++)
		document.getElementById("a"+i).src="/images/icon/useful/grade_all.gif";
	for(i=5;i>num;i--)
		document.getElementById("a"+i).src="/images/icon/useful/grade_all_n.gif";
	if(num=="1")
		document.getElementById("a_memo").innerHTML="很糟糕";
	if(num=="2")
		document.getElementById("a_memo").innerHTML="马马虎虎";
	if(num=="3")
		document.getElementById("a_memo").innerHTML="一般";
	if(num=="4")
		document.getElementById("a_memo").innerHTML="好";
	if(num=="5")
		document.getElementById("a_memo").innerHTML="非常满意";
}

function gradeonb(obj)
{
	var objid=obj.id;
	var i;
	var num=objid.substr(1,1);
	for(i=1;i<=num;i++)
		document.getElementById("b"+i).src="/images/icon/useful/grade.gif";
	for(i=5;i>num;i--)
		document.getElementById("b"+i).src="/images/icon/useful/grade_n.gif";
	if(num=="1")
		document.getElementById("b_memo").innerHTML="很糟糕";
	if(num=="2")
		document.getElementById("b_memo").innerHTML="马马虎虎";
	if(num=="3")
		document.getElementById("b_memo").innerHTML="一般";
	if(num=="4")
		document.getElementById("b_memo").innerHTML="好";
	if(num=="5")
		document.getElementById("b_memo").innerHTML="非常满意";
}
function gradeonc(obj)
{
	var objid=obj.id;
	var i;
	var num=objid.substr(1,1);
	for(i=1;i<=num;i++)
		document.getElementById("c"+i).src="/images/icon/useful/grade.gif";
	for(i=5;i>num;i--)
		document.getElementById("c"+i).src="/images/icon/useful/grade_n.gif";
	if(num=="1")
		document.getElementById("c_memo").innerHTML="很糟糕";
	if(num=="2")
		document.getElementById("c_memo").innerHTML="马马虎虎";
	if(num=="3")
		document.getElementById("c_memo").innerHTML="一般";
	if(num=="4")
		document.getElementById("c_memo").innerHTML="好";
	if(num=="5")
		document.getElementById("c_memo").innerHTML="非常满意";
}
function gradeond(obj)
{
	var objid=obj.id;
	var i;
	var num=objid.substr(1,1);
	for(i=1;i<=num;i++)
		document.getElementById("d"+i).src="/images/icon/useful/grade.gif";
	for(i=5;i>num;i--)
		document.getElementById("d"+i).src="/images/icon/useful/grade_n.gif";
	if(num=="1")
		document.getElementById("d_memo").innerHTML="很糟糕";
	if(num=="2")
		document.getElementById("d_memo").innerHTML="马马虎虎";
	if(num=="3")
		document.getElementById("d_memo").innerHTML="一般";
	if(num=="4")
		document.getElementById("d_memo").innerHTML="好";
	if(num=="5")
		document.getElementById("d_memo").innerHTML="非常满意";
}

function gradeouta()
{
	for(var i=1;i<=5;i++)
		document.getElementById("a"+i).src="/images/icon/useful/grade_all_n.gif";
	document.getElementById("a_memo").innerHTML="";
	if(a!=0)
	{
		for(i=1;i<=a;i++)
			document.getElementById("a"+i).src="/images/icon/useful/grade_all.gif";
		for(i=5;i>a;i--)
			document.getElementById("a"+i).src="/images/icon/useful/grade_all_n.gif";
		
	}
}

function gradeoutb()
{
	for(var i=1;i<=5;i++)
		document.getElementById("b"+i).src="/images/icon/useful/grade_n.gif";
	document.getElementById("b_memo").innerHTML="";
	if(b!=0)
	{
		for(i=1;i<=b;i++)
			document.getElementById("b"+i).src="/images/icon/useful/grade.gif";
		for(i=5;i>b;i--)
			document.getElementById("b"+i).src="/images/icon/useful/grade_n.gif";
		
	}
}

function gradeoutc()
{
	for(var i=1;i<=5;i++)
		document.getElementById("c"+i).src="/images/icon/useful/grade_n.gif";
	document.getElementById("c_memo").innerHTML="";
	if(c!=0)
	{
		for(i=1;i<=c;i++)
			document.getElementById("c"+i).src="/images/icon/useful/grade.gif";
		for(i=5;i>c;i--)
			document.getElementById("c"+i).src="/images/icon/useful/grade_n.gif";
		
	}
}
function gradeoutd()
{
	for(var i=1;i<=5;i++)
		document.getElementById("d"+i).src="/images/icon/useful/grade_n.gif";
	document.getElementById("d_memo").innerHTML="";
	if(d!=0)
	{
		for(i=1;i<=d;i++)
			document.getElementById("d"+i).src="/images/icon/useful/grade.gif";
		for(i=5;i>d;i--)
			document.getElementById("d"+i).src="/images/icon/useful/grade_n.gif";
		
	}
}


function gradeclicka(obj)
{
	var objid=obj.id;
	var i;
	var num=objid.substr(1,1);
	for(i=1;i<=num;i++)
		document.getElementById("a"+i).src="/images/icon/useful/grade_all.gif";
	a=num;
	frm_grade.grade.value=a;
}

function gradeclickb(obj)
{
	var objid=obj.id;
	var i;
	var num=objid.substr(1,1);
	for(i=1;i<=num;i++)
		document.getElementById("b"+i).src="/images/icon/useful/grade.gif";
	b=num;
	frm_grade.grade1.value=b;
}

function gradeclickc(obj)
{
	var objid=obj.id;
	var i;
	var num=objid.substr(1,1);
	for(i=1;i<=num;i++)
		document.getElementById("c"+i).src="/images/icon/useful/grade.gif";
	c=num;
	frm_grade.grade2.value=c;
}

function gradeclickd(obj)
{
	var objid=obj.id;
	var i;
	var num=objid.substr(1,1);
	for(i=1;i<=num;i++)
		document.getElementById("d"+i).src="/images/icon/useful/grade.gif";
	d=num;
	frm_grade.grade3.value=d;
}

function onlygrade()
{
	if(frm_grade.grade.value==""||frm_grade.grade1.value==""||frm_grade.grade2.value==""||frm_grade.grade3.value=="")
	{
		document.getElementById("tip").innerHTML="请选择您的评分！";
		return false;
	}
	frm_grade.action="/operate/script/gradeadd1";
	frm_grade.submit();
	
}

function flower(grdid)
{
	var ajax=new InitAjax();
	var url="/operate/script/flower";
	var post_str="grdid="+grdid;
	ajax.open("POST",url,true);
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.send(post_str);
	ajax.onreadystatechange = function()
	{
		if(ajax.readyState==4&&ajax.status==200)
		{
			var flag=ajax.responseText;
			if(flag=="error")
			{
				document.getElementById("opera_tip"+grdid).innerHTML="登入后才能发表点评!";
			}
			else
			{
				if(flag=="0")
					document.getElementById("opera_tip"+grdid).innerHTML="您已点评过，请不要重复点评!";
				else
				{
					var str=document.getElementById("ope"+grdid).innerHTML;
					var n=str.indexOf("鲜花");
					var n_str=str.substr(n);
					var x=n_str.indexOf("</a>");
					var m=n_str.indexOf("&");
					var tmp_str1=str.substr(0,n+x+7);
					var tmp_str2=str.substr(n+m);
						document.getElementById("ope"+grdid).innerHTML=tmp_str1+"("+flag+")"+tmp_str2;
				}
			}
		}
	}
}

function egg(grdid)
{
	var ajax=new InitAjax();
	var url="/operate/script/egg";
	var post_str="grdid="+grdid;
	ajax.open("POST",url,true);
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.send(post_str);
	ajax.onreadystatechange = function()
	{
		if(ajax.readyState==4&&ajax.status==200)
		{
			var flag=ajax.responseText;
			if(flag=="error")
			{
				document.getElementById("opera_tip"+grdid).innerHTML="登入后才能发表点评!";
			}
			else
			{
				if(flag=="0")
					document.getElementById("opera_tip"+grdid).innerHTML="您已点评过，请不要重复点评!";
				else
				{
					var str=document.getElementById("ope"+grdid).innerHTML;
					var n=str.indexOf("臭鸡蛋");
					var n_str=str.substr(n);
					var x=n_str.indexOf("</a>");
					var m=n_str.indexOf("&");
					var tmp_str1=str.substr(0,n+x+8);
					var tmp_str2=str.substr(n+m);
						document.getElementById("ope"+grdid).innerHTML=tmp_str1+"<font color=blue>("+flag+")</font>"+tmp_str2;
				}
			}
		}
	}
}

function uploadg(obj)
{
	var str=document.frm_grade.grade_pics.value;
	str1="|";
	if(countInstances(str,str1)>=5)
	{	
		document.getElementById("tips").innerHTML="最多只能上传五张图";
		return false;
	}
	else
	{
		window.open("/upfile/opera/upgradefile?"+obj,'','width=380px,height=110px,toolbar=no');
	}
}

function countInstances(mainStr, srchStr) {
    var count = 0;
    var offset = 0;
    do {
        offset = mainStr.indexOf(srchStr, offset);
        count += (offset != -1) ? 1 : 0;
    } while (offset++ != -1)
    return count
}

function lgn(obj)
{
	obj.innerHTML="必须先登入才能发表回复!";
}

function oTime()
{
	var ajax=new InitAjax();
	var url="/operate/script/oTime";
	ajax.open("POST",url,true);
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.send();
	
	ajax.onreadystatechange = function()
	{
		if(ajax.readyState==4&&ajax.status==200)
		{
			window.location.reload();
		}
	}
}

function oFlower()
{
	var ajax=new InitAjax();
	var url="/operate/script/oFlower";
	ajax.open("POST",url,true);
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.send();
	
	ajax.onreadystatechange = function()
	{
		if(ajax.readyState==4&&ajax.status==200)
		{
			window.location.reload();
		}
	}
}

function iwent(id)
{
	try
	{
		var ajax1=InitAjax();
		ajax1.open("GET","/operate/script/checkuser",true);
		ajax1.send();
		ajax1.onreadystatechange=function()
		{
			if(ajax1.readyState==4&&ajax1.status==200)
			{
				var resulte=ajax1.responseText;
				if(resulte=="1")
				{
					var ajax=new InitAjax();
					var url="/operate/opera/iwent?"+id;
					ajax.open("GET",url,true);
					ajax.send();
					ajax.onreadystatechange=function()
					{
						if(ajax.readyState==4&&ajax.status==200)
						{
							var resulte=ajax.responseText;
							if(resulte!="0"&&resulte!="1")
							{
								var str=resulte+document.getElementById("rmd_2").innerHTML;
								document.getElementById("rmd_2").innerHTML=str;
								document.getElementById("iwent").innerHTML='<a href=# class="Link_3" onclick="notwent('+id+');return false;">我没去过</a>'
								
							}
						}
					}
	
				}
				else
				{
					addCreate();
					errorDialog();
				}
			}
		}
	}catch(e){}
	
}

function errorDialog()
{
	var errorDialog=document.createElement("div");
	errorDialog.id="errorDialog";
	errorDialog.style.position="absolute";
	errorDialog.style.width="380px";
	errorDialog.style.height="250px";
	errorDialog.style.background="url(/images/index/login.gif) no-repeat";
	errorDialog.style.left=(document.body.clientWidth/2-190)+document.body.scrollLeft+"px";
	errorDialog.style.top=150+"px";
	errorDialog.style.zindex="10";
	var add_win;
	add_win="<div id='add_win'>";
	add_win+="<div id='add_close' style='float:right;padding-top:8px;padding-right:10px;' ><img src='/images/index/close.gif' border='0' style='cursor:hand;margin-right:15px;' onclick='errorDelete()'></div>";
	add_win+="<div id='add_main' style='padding-top:25px;'>";
	add_win+="<table width=98% border=0 cellpadding=2 cellspacing=2><tr><td align=center style='font-size:14px;font-weight:bold;color:#FF9900;line-height:180%;' valign='top'><br>您选择的操作需要登入才能继续！<br>请先登入或快速注册!</td></tr>";
	add_win+="<tr><td align=center><br><br><input type='button' value='登入' class='frm' onclick=goto_url(location.href,'/user/opera/userlogin_comm');>&nbsp;&nbsp;<input type='button' value='快速注册' class='frm' onclick=goto_url(location.href,'/user/opera/userregister_comm')>&nbsp;&nbsp;<input type='button' value='取消' class='frm' onclick='errorDelete()'></td></tr>";
	add_win+="</table>";
	add_win+="</div>";
	add_win+="</div>";
	errorDialog.innerHTML=add_win;
	document.body.appendChild(errorDialog);
}

function errorDelete()
{
	if(typeof(oDiv)=="object")
		oDiv.removeNode(true);
	document.getElementById("errorDialog").removeNode(true);
}

function addphone(obj,sjid,phonenum)
{
	var ajax=InitAjax();
	var url="/phoneadd?sjid="+sjid+"&phonenum="+phonenum;
	ajax.open("GET",url,true);
	ajax.send();
	ajax.onreadystatechange=function()
	{
		if(ajax.readyState==4&&ajax.status==200)
		{
			resulte=ajax.responseText;
			if(resulte!="0")
			{
				document.getElementById("phone").innerHTML="<strong>联系电话:</strong>"+resulte;
				phoneaddDelete();
			}
			else
			{
				obj.innerHTML="<font color=red>出现错误!</font>";
			}
		}
	}
}

function phoneaddDialog(sjid)
{
	var phoneaddDialog=document.createElement("div");
	phoneaddDialog.id="phoneaddDialog";
	phoneaddDialog.style.position="absolute";
	phoneaddDialog.style.width="380px";
	phoneaddDialog.style.height="250px";
	phoneaddDialog.style.background="url(/images/index/login.gif) no-repeat";
	phoneaddDialog.style.left=(document.body.clientWidth/2-190)+"px";
	phoneaddDialog.style.top=150+"px";
	phoneaddDialog.style.zindex="10";
	var add_win;
	add_win="<div style='padding:15px;text-align:center;'>";
	add_win+="<div style='width:350px;text-align:right;'><img src='/images/index/close.gif' border='0' style='cursor:hand;margin-right:15px;' onclick='phoneaddDelete()'></div>";
	add_win+="<div style='width:350px;border-bottom:2px solid #EEEEEE;font-size:14px;font-weight:bold;padding-top:15px;padding-bottom:8px;'>";
	add_win+="添加商家联系电话";
	add_win+="</div>";
	add_win+="<div id='div_phone' style='width:350px;padding-top:25px;font-weight:bold;font-size:14px;'>电话号码:&nbsp;&nbsp;<input name='iphone' id='iphone' type='text' class='frm_text' size='35' maxlength='25'><br>";
	add_win+="<br><br><input type='button' value='确认添加' class='frm' onclick=addphone(document.getElementById('div_phone'),'"+sjid+"',iphone.value)>";
	add_win+="</div>";
	add_win+="</div>";
	phoneaddDialog.innerHTML=add_win;
	document.body.appendChild(phoneaddDialog);
}

function phoneaddDelete()
{
	if(typeof(oDiv)=="object")
		oDiv.removeNode(true);
	document.getElementById("phoneaddDialog").removeNode(true);
}

function phoneadd(sjid)
{
	var ajax=InitAjax();
	ajax.open("GET","/operate/script/checkuser",true);
	ajax.send();
	ajax.onreadystatechange=function()
	{
		if(ajax.readyState==4&&ajax.status==200)
		{
			var resulte=ajax.responseText;
			if(resulte=="1")
			{
				addCreate();
				phoneaddDialog(sjid);
			}
			else
			{
				addCreate();
				errorDialog();
			}
		}
	}
}

function addtraffic(obj,sjid,traffic)
{
	var ajax=InitAjax();
	var url="/trafficadd?sjid="+sjid+"&traffic="+traffic;
	ajax.open("GET",url,true);
	ajax.send();
	ajax.onreadystatechange=function()
	{
		if(ajax.readyState==4&&ajax.status==200)
		{
			resulte=ajax.responseText;
			if(resulte!="0")
			{
				document.getElementById("traffic").innerHTML="<strong>交通:</strong>"+resulte;
				trafficaddDelete();
			}
			else
			{
				obj.innerHTML="<font color=red>出现错误!</font>";
			}
		}
	}
}


function trafficaddDialog(sjid)
{
	var trafficaddDialog=document.createElement("div");
	trafficaddDialog.id="trafficaddDialog";
	trafficaddDialog.style.position="absolute";
	trafficaddDialog.style.width="380px";
	trafficaddDialog.style.height="250px";
	trafficaddDialog.style.background="url(/images/index/login.gif) no-repeat";
	trafficaddDialog.style.left=(document.body.clientWidth/2-190)+"px";
	trafficaddDialog.style.top=150+"px";
	trafficaddDialog.style.zindex="10";
	var add_win;
	add_win="<div style='padding:15px;text-align:center;'>";
	add_win+="<div style='width:350px;text-align:right;'><img src='/images/index/close.gif' border='0' style='cursor:hand;margin-right:15px' onclick='trafficaddDelete()'></div>";
	add_win+="<div style='width:350px;border-bottom:2px solid #EEEEEE;font-size:14px;font-weight:bold;padding-top:15px;padding-bottom:8px;'>";
	add_win+="添加商家交通情况";
	add_win+="</div>";
	add_win+="<div id='div_traffic' style='width:350px;padding-top:25px;font-weight:bold;font-size:14px;'>交通:&nbsp;&nbsp;<input name='itraffic' id='itraffic' type='text' class='frm_text' size='35' maxlength='25'><br>";
	add_win+="<br><br><input type='button' value='确认添加' class='frm' onclick=addtraffic(document.getElementById('div_traffic'),'"+sjid+"',itraffic.value)>";
	add_win+="</div>";
	add_win+="</div>";
	trafficaddDialog.innerHTML=add_win;
	document.body.appendChild(trafficaddDialog);
}

function trafficaddDelete()
{
	if(typeof(oDiv)=="object")
		oDiv.removeNode(true);
	document.getElementById("trafficaddDialog").removeNode(true);
}

function trafficadd(sjid)
{
	var ajax=InitAjax();
	ajax.open("GET","/operate/script/checkuser",true);
	ajax.send();
	ajax.onreadystatechange=function()
	{
		if(ajax.readyState==4&&ajax.status==200)
		{
			var resulte=ajax.responseText;
			if(resulte=="1")
			{
				addCreate();
				trafficaddDialog(sjid);
			}
			else
			{
				addCreate();
				errorDialog();
			}
		}
	}
	
}

function addbuild(obj,sjid,build)
{
	var ajax=InitAjax();
	var url="/buildadd?sjid="+sjid+"&build="+build;
	ajax.open("GET",url,true);
	ajax.send();
	ajax.onreadystatechange=function()
	{
		if(ajax.readyState==4&&ajax.status==200)
		{
			resulte=ajax.responseText;
			if(resulte!="0")
			{
				document.getElementById("build").innerHTML="<strong>附近地标:</strong>"+resulte;
				buildaddDelete();
			}
			else
			{
				obj.innerHTML="<font color=red>出现错误!</font>";
			}
		}
	}
}

function buildaddDialog(sjid)
{
	var buildaddDialog=document.createElement("div");
	buildaddDialog.id="buildaddDialog";
	buildaddDialog.style.position="absolute";
	buildaddDialog.style.width="380px";
	buildaddDialog.style.height="250px";
	buildaddDialog.style.background="url(/images/index/login.gif) no-repeat";
	buildaddDialog.style.left=(document.body.clientWidth/2-190)+"px";
	buildaddDialog.style.top=150+"px";
	buildaddDialog.style.zindex="10";
	var add_win;
	add_win="<div style='padding:15px;text-align:center;'>";
	add_win+="<div style='width:350px;text-align:right;'><img src='/images/index/close.gif' border='0' style='cursor:hand;margin-right:15px;' onclick='buildaddDelete()'></div>";
	add_win+="<div style='width:350px;border-bottom:2px solid #EEEEEE;font-size:14px;font-weight:bold;padding-top:15px;padding-bottom:8px;'>";
	add_win+="添加商家附近地标";
	add_win+="</div>";
	add_win+="<div id='div_build' style='width:350px;padding-top:25px;font-weight:bold;font-size:14px;'>附近地标:&nbsp;&nbsp;<input name='ibuild' id='ibuild' type='text' class='frm_text' size='35' maxlength='25'><br>";
	add_win+="<br><br><input type='button' value='确认添加' class='frm' onclick=addbuild(document.getElementById('div_build'),'"+sjid+"',ibuild.value)>";
	add_win+="</div>";
	add_win+="</div>";
	buildaddDialog.innerHTML=add_win;
	document.body.appendChild(buildaddDialog);
}

function buildaddDelete()
{
	if(typeof(oDiv)=="object")
		oDiv.removeNode(true);
	document.getElementById("buildaddDialog").removeNode(true);
}

function buildadd(sjid)
{
	var ajax=InitAjax();
	ajax.open("GET","/operate/script/checkuser",true);
	ajax.send();
	ajax.onreadystatechange=function()
	{
		if(ajax.readyState==4&&ajax.status==200)
		{
			var resulte=ajax.responseText;
			if(resulte=="1")
			{
				addCreate();
				buildaddDialog(sjid);
			}
			else
			{
				addCreate();
				errorDialog();
			}
		}
	}
}

function tag_help_open(evt)
{
	tag_help.style.left=evt.x+document.body.scrollLeft-35;
	tag_help.style.top=evt.y+document.body.scrollTop;
	tag_help.style.display="";
}

function tag_help_close()
{
	document.getElementById("tag_help").style.display="none";
}

function s_submit()
{
	if(srhfrm.key.value=="")
	{
		srhfrm.key.style.color="red";
		srhfrm.key.value="请输入关键词";
		return false;
	}
	else
	{
		srhfrm.submit();
	}
}

function tradeedit(sjmd5)
{
	var ajax=InitAjax();
	ajax.open("GET","/operate/script/checkuser",true);
	ajax.send();
	ajax.onreadystatechange=function()
	{
		if(ajax.readyState==4&&ajax.status==200)
		{
			var resulte=ajax.responseText;
			if(resulte=="1")
			{
				location.href="/tradeedit/"+sjmd5;
			}
			else
			{
				addCreate();
				errorDialog();
			}
		}
	}
}

function report_error()
{
	var ajax=InitAjax();
	ajax.open("GET","/operate/script/checkuser",true);
	ajax.send();
	ajax.onreadystatechange=function()
	{
		if(ajax.readyState==4&&ajax.status==200)
		{
			var resulte=ajax.responseText;
			if(resulte=="1")
			{
				if(rpt_frm.report_cnt.value=="")
				{
					document.getElementById("report_error").innerHTML="错误提示：请选择举报原因!";
					return false;
				}
				if(rpt_frm.report_cnt.value=="其他" && rpt_frm.oreport.value=="")
				{
					document.getElementById("report_error").innerHTML="错误提示：请输入举报原因!";
					return false;
				}
				rpt_frm.action="/report";
				rpt_frm.submit();
			}
			else
			{
				addCreate();
				errorDialog();
			}
		}
	}
}

function store_print(sjmd5)
{
	window.open('/print/'+sjmd5,'','width=780,height=580,menubar=no,toolbar=yes,top=10,left=10,scrollbars=yes');
}

function goto_url(url,hrf)
{
	url=char_replace(url,"|");
	location.href=hrf+"?"+url;
}

function char_replace(str,char)
{
	var new_str="";
	for(var i=0;i<str.length;i++)
		if(str.substr(i,1)=="/")
			new_str=new_str+char;
		else
			new_str=new_str+str.substr(i,1);
	return new_str;
}

function pic_add(sjmd5)
{
	var ajax=InitAjax();
	ajax.open("GET","/operate/script/checkuser",true);
	ajax.send();
	ajax.onreadystatechange=function()
	{
		if(ajax.readyState==4&&ajax.status==200)
		{
			var resulte=ajax.responseText;
			if(resulte=="1")
			{
				location.href="/tradeedit_picadd/"+sjmd5+"#picadd";
			}
			else
			{
				addCreate();
				errorDialog();
			}
		}
	}
}

function notwent(id)
{
	try
	{
		var ajax=InitAjax();
		var url="/notwent/"+id;
		ajax.open("GET",url,true);
		ajax.send();
		ajax.onreadystatechange=function()
		{
			if(ajax.readyState==4&&ajax.status==200)
			{
				var resulte=ajax.responseText;
				if(resulte!="0")
				{
					document.getElementById("rmd_2").innerHTML=resulte;
					document.getElementById("iwent").innerHTML='<a href=# class="Link_3" onclick="iwent('+id+');return false;">我去过</a>'
				}
			}
		}
	}catch(e){}
}