function RegCheck()//新用户注册输入检查
{
	if(document.RegForm.user_name.value.length == 0)
	{
		alert("请输入[用户名]");
		document.RegForm.user_name.focus();
		return false;
	}
	
	if(document.RegForm.password1.value.length == 0)
	{
		alert("请输入[密码]");
		document.RegForm.password1.focus();
		return false;
	}
	
	if(document.RegForm.password2.value.length == 0)
	{
		alert("请再次输入[密码]");
		document.RegForm.password2.focus();
		return false;
	}
	
	if(document.RegForm.real_name.value.length == 0)
	{
		alert("[联系人]?");
		document.RegForm.real_name.focus();
		return false;
	}	
	
	if(document.RegForm.email.value.length == 0)
	{
		alert("[管理员email]?");
		document.RegForm.email.focus();
		return false;
	}	
	
	if(document.RegForm.company_type.value.length == 0)
	{
		alert("您忘了[选择行业]");
		document.RegForm.company_type.focus();
		return false;
	}

	if(document.RegForm.company_shortname.value.length == 0)
	{
		alert("[公司简称]必需填写");
		document.RegForm.company_shortname.focus();
		return false;
	}

	if(document.RegForm.company_address.value.length == 0)
	{
		alert("[公司注册地址]没有填写哦");
		document.RegForm.company_address.focus();
		return false;
	}		

	if(document.RegForm.company_zone.value.length == 0)
	{
		alert("您忘了[选择地区]");
		document.RegForm.company_zone.focus();
		return false;
	}
	
	if(document.RegForm.company_tel.value.length == 0&&document.RegForm.company_fax.value.length == 0&&document.RegForm.mobil.value.length == 0)
	{
		alert("请填写您的电话");
		document.RegForm.company_tel.focus();
		return false;
	}	
	
	
	
	
		
	return true;
}




function add_memo()//添加留言
 {
	var e=window.event.srcElement,n=e;
	while(n=n.previousSibling)if(n.name=="memo[]")break;
	if(n)n.value+=e.value
}

function add_memo_all()//添加留言to all
 {
	var e=window.event.srcElement,n=e;
	while(n=n.previousSibling)if(n.name=="memo_all")break;
	if(n)n.value+=e.value
}




function showtip(text)  //显示链接的说明
{
	if (document.all&&document.readyState=="complete")//针对IE
	{
		 //显示跑马灯,内容就是提示框的内容
		document.all.tooltip.innerHTML="<div vAlign=center><font style='font-size: 12px;'>"+text+"</font></div>";
		document.all.tooltip.style.pixelLeft=event.clientX+document.body.scrollLeft;
		document.all.tooltip.style.pixelTop=event.clientY+document.body.scrollTop+20;
		 if (event.clientX>900)
		{
			document.all.tooltip.style.pixelLeft=780;
			document.all.tooltip.style.pixelTop=event.clientY+document.body.scrollTop+20;
		}
		document.all.tooltip.style.visibility="visible";
	}
}

document.write(
	"<div id=\"tooltip\" style=\"position:absolute;visibility:hidden; padding:3px;border:1px solid #C0C0C0;\
	;background-color:#D1F2AA; height: 19px; left:77;top: 96px;z-index:10;\"></div>");
function hidetip()  //隐藏链接的说明
{
	if (document.all)
	document.all.tooltip.style.visibility="hidden";
}

function setcolor(fntcolor,bgcolor)
{
	document.all.tooltip.style.bgcolor=bgcolor;
	document.all.tooltip.innerHTML.Color = fntcolor;
}

function showhint(text)
{
	onmousemove=showtip(text);
	onmouseover=showtip(text);
	onmouseout=hidetip();
}

function view(id) {
	var viewurl="/profile1.jsp?user="+id;
	window.open(viewurl,'viewurl','left=70,top=20,width=450,height=320,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no');

}

function CheckAll(form){
	for (var i=0;i<form.elements.length;i++)
    		{
    			var e = form.elements[i];
    			if (e.name != 'chkall')
       			e.checked = form.chkall.checked;
    		}
}



//库存上载确认
function confirm_csv(){
	

	if(document.upload_csv.mode[0].checked){
		return confirm("删除以前所有库存数据 (用本次上载的文件替代)?");
	}
	
	if(document.upload_csv.mode[1].checked){
		return ture;
	}
}


function confirm_txt(){
	

	if(document.upload_txt.mode[0].checked){
		return confirm("删除以前所有库存数据 (用本次粘贴的数据替代)?");
	}
	
	if(document.upload_txt.mode[1].checked){
		return ture;
	}
}




function confirm_table(){
	

	if(document.upload_table.mode[0].checked){
		return confirm("删除以前所有库存数据 (用本次输入的数据替代)?");
	}
	
	if(document.upload_table.mode[1].checked){
		return ture;
	}
}











//编辑.热卖
function edit_hotoffer(tableobj,row,ic,mfr,pkg,dc,memo,mini,price,qty,memo1,edit_hot_id,del){
	tableobj.rows[row].cells[0].innerHTML= "<input style='width: 100%;' name=content value=\"" +  + "\">";
	tableobj.rows[row].cells[1].innerHTML= "<input style='width: 100%;' name=ic value=\"" + ic + "\">";
	tableobj.rows[row].cells[2].innerHTML= "<input style='width: 100%;' name=mfr value=\"" + mfr + "\">";
	tableobj.rows[row].cells[3].innerHTML= "<input style='width: 100%;' name=pkg value=\"" + pkg + "\">";
	tableobj.rows[row].cells[4].innerHTML= "<input style='width: 100%;' name=dc value=\"" + dc + "\">";
	tableobj.rows[row].cells[5].innerHTML= "<input style='width: 100%;' name=memo value=\"" + memo + "\">";
	tableobj.rows[row].cells[6].innerHTML= "<input style='width: 100%;' name=mini value=\"" + mini + "\">";
	tableobj.rows[row].cells[7].innerHTML= "<input style='width: 100%;' name=price value=\"" + price + "\">";
	tableobj.rows[row].cells[8].innerHTML= "<input style='width: 100%;' name=qty value=\"" + qty + "\">";
	tableobj.rows[row].cells[9].innerHTML= "<input style='width: 100%;' name=memo1 value=\"" + memo1 + "\">";
	
	tableobj.rows[row].cells[10].innerHTML= "<input type=\"hidden\" name=\"edit_hot_id\" value=\"" + edit_hot_id + "\"><input type=\"submit\" value=\"修改\"  class=\"buttom\"> - <A href=\"" + del + "\" onclick='return confirm(\"确定删除？\")'>删除</A> ";
	
	return false;
}

//编辑.库存
function edit_stock(tableobj,row,ic,mfr,pkg,dc,memo,mini,price,qty,memo1,stock_id,del){
	tableobj.rows[row].cells[0].innerHTML= "<input style='width: 100%;' name=ic value=\"" + ic + "\">";
	tableobj.rows[row].cells[1].innerHTML= "<input style='width: 100%;' name=mfr value=\"" + mfr + "\">";
	tableobj.rows[row].cells[2].innerHTML= "<input style='width: 100%;' name=pkg value=\"" + pkg + "\">";
	tableobj.rows[row].cells[3].innerHTML= "<input style='width: 100%;' name=dc value=\"" + dc + "\">";
	tableobj.rows[row].cells[4].innerHTML= "<input style='width: 100%;' name=memo value=\"" + memo + "\">";
	tableobj.rows[row].cells[5].innerHTML= "<input style='width: 100%;' name=mini value=\"" + mini + "\">";
	tableobj.rows[row].cells[6].innerHTML= "<input style='width: 100%;' name=price value=\"" + price + "\">";
	tableobj.rows[row].cells[7].innerHTML= "<input style='width: 100%;' name=qty value=\"" + qty + "\">";
	tableobj.rows[row].cells[8].innerHTML= "<input style='width: 100%;' name=memo1 value=\"" + memo1 + "\">";
	
	tableobj.rows[row].cells[9].innerHTML= "<input type=\"submit\" value=\"修改\"  class=\"buttom\"> - <A href=\"" + del + "\" onclick='return confirm(\"确定删除？\")'>删除</A> ";
	return false;
} 
 
//编辑.买
function edit_buy(tableobj,row,ic,mfr,pkg,dc,memo,price,qty,edit_buy_id,del){
	tableobj.rows[row].cells[0].innerHTML= "<input style='width: 100%;' name=content value=\"" +  + "\">";
	tableobj.rows[row].cells[1].innerHTML= "<input style='width: 100%;' name=ic value=\"" + ic + "\">";
	tableobj.rows[row].cells[2].innerHTML= "<input style='width: 100%;' name=mfr value=\"" + mfr + "\">";
	tableobj.rows[row].cells[3].innerHTML= "<input style='width: 100%;' name=pkg value=\"" + pkg + "\">";
	tableobj.rows[row].cells[4].innerHTML= "<input style='width: 100%;' name=dc value=\"" + dc + "\">";
	tableobj.rows[row].cells[5].innerHTML= "<input style='width: 100%;' name=memo value=\"" + memo + "\">";

	tableobj.rows[row].cells[6].innerHTML= "<input style='width: 100%;' name=price value=\"" + price + "\">";
	tableobj.rows[row].cells[7].innerHTML= "<input style='width: 100%;' name=qty value=\"" + qty + "\">";

	tableobj.rows[row].cells[8].innerHTML= "<input type=\"hidden\" name=\"edit_buy_id\" value=\"" + edit_buy_id + "\"><input type=\"submit\" value=\"修改\"  class=\"buttom\"> - <A href=\"" + del + "\" onclick='return confirm(\"确定删除？\")'>删除</A> ";
	
	return false;
} 