function checkRgo(userid)
{
	if(userid<=0)
		alert("您还没登录，请登录");
	else
	location.href='/servlet/com.servlet.rc.CheckRgo';
}
function checkPgo(userid)
{
if(userid<=0)
	alert("您还没登录，请登录");
else
	location.href='/servlet/com.servlet.rc.CheckPgo';
}
function tbladdrow() 
{
var obj=3+tableBody.rows.length;
//alert(obj);
var sum=obj;
var row=tableBody.insertRow(tableBody.rows.length);
var col = row.insertCell(0);
col.innerHTML="<select name='jia"+sum+"type'><option value='1'> 早餐</option><option value='2'> 午餐</option><option value='3'> 晚餐</option><option value='4'> 加餐</option></select>";
col = row.insertCell(1);
col.innerHTML = "<input style='width:50px; color:#c2c2c2 ;height:15px' name='jia"+sum+"time'  value='7:00' type='text' onclick='kong(this)' />";
col = row.insertCell(2);
col.innerHTML="<textarea name='jia"+sum+"' style='width:350px;  height:55px;color:#c2c2c2;border:1px solid #ffffff' onclick='kong(this)' > 这顿吃了什么，吃了多少呢？赶紧写下来吧。</textarea>";
col = row.insertCell(3);
col.innerHTML="<select name='jia"+sum+"qian' ><option value='1'> 饥饿</option><option value='2'> 饿</option><option value='3'> 稍饿</option><option value='4'> 适中</option><option value='5'> 饱了</option><option value='6'> 撑了</option></select><select name='jia"+sum+"hou' ><option value='1'> 饥饿</option><option value='2'> 饿</option><option value='3'> 稍饿</option><option value='4'> 适中</option><option value='5'> 饱了</option><option value='6'> 撑了</option></select>";
document.all("addsum").value=obj;
}



function delrow()
{
if(tableBody.rows.length==0)
{
return false ;
}
tableBody.deleteRow();
document.all("addsum").value=tableBody.rows.length;
}
function face(flag,obj)
{
	var src=obj.src;
	if(flag=="1")
		document.all("faces").innerHTML="<img src='"+src+"' alt='高兴'>";
	else if(flag=="2")
		document.all("faces").innerHTML="<img src='"+src+"' alt='快乐'>";
	else if(flag=="3")
		document.all("faces").innerHTML="<img src='"+src+"' alt='大笑'>";
	else if(flag=="4")
		document.all("faces").innerHTML="<img src='"+src+"' alt='委屈'>";
	else if(flag=="5")
		document.all("faces").innerHTML="<img src='"+src+"' alt='睡'>";
	else if(flag=="6")
		document.all("faces").innerHTML="<img src='"+src+"' alt='不高兴'>";
	else if(flag=="7")
		document.all("faces").innerHTML="<img src='"+src+"' alt='饥饿'>";
	else if(flag=="8")
		document.all("faces").innerHTML="<img src='"+src+"' alt='坏笑'>";
	else if(flag=="9")
		document.all("faces").innerHTML="<img src='"+src+"' alt='生气'>";
	else if(flag=="10")
		document.all("faces").innerHTML="<img src='"+src+"' alt='汗'>";
	else if(flag=="11")
		document.all("faces").innerHTML="<img src='"+src+"' alt='害羞'>";
	else if(flag=="12")
		document.all("faces").innerHTML="<img src='"+src+"' alt='可爱'>";
	else if(flag=="13")
		document.all("faces").innerHTML="<img src='"+src+"' alt='装酷'>";
	else if(flag=="14")
		document.all("faces").innerHTML="<img src='"+src+"' alt='惊讶'>";	
	document.all("brow").value=flag;
}
function setOther(type)
{
document.all("other").value=1;
}
function shui(img,i)
{
	
	sum=eval(document.all("water").value);
	if(img.src.indexOf("emptywa.gif")!=-1) //没亮的时候
	{alterAll(1);
		img.src="/rc/images/fullwa.gif";
		document.all("water").value=i;
		document.all("shuis").innerHTML=i;
		
	}
	else                                   //亮的时候
	{
		img.src="/rc/images/emptywa.gif";
		document.all("water").value=0;
		document.all("shuis").innerHTML=0;
		
	}
}
function cai(img,i)
{
	
	sum=eval(document.all("gre").value);
	if(img.src.indexOf("reveget.gif")!=-1)
	{alterAll(2);
		img.src="/rc/images/reveget1.gif";
		document.all("gre").value=i;
		document.all("cais").innerHTML=i;
		
	}
	else
	{
		img.src="/rc/images/reveget.gif";
		document.all("gre").value=0;
		document.all("cais").innerHTML=0;
		
	}
}
function shuoguos(img,i)
{
	sum=eval(document.all("fruit").value);
	if(img.src.indexOf("fruit.gif")!=-1)
	{alterAll(3);
		img.src="/rc/images/fruit1.gif";
		document.all("fruit").value=i;
		document.all("shuoguo").innerHTML=i;
		
	}
	else
	{
		img.src="/rc/images/fruit.gif";
		document.all("fruit").value=0;
		document.all("shuoguo").innerHTML=0;
		
	}
}
function alterAll(type)
{
	if(type==1)
	{for(var k=1;k<=10;k++)
	document.all("shuiss"+k).src="/rc/images/emptywa.gif";
	}
	else if(type==2)
	{for(var k=1;k<=10;k++)
	document.all("shuss"+k).src="/rc/images/reveget.gif";
	}
	else if(type==3)
	{for(var k=1;k<=10;k++)
	document.all("shuigus"+k).src="/rc/images/fruit.gif";
	}
}
