//翻页的跳转
function GoToTheUrl(TheSelect)
{
	window.open(TheSelect.value,"_self");
}
//搜索
function SearchBtn()
{
	TheNr=document.getElementById("TheSearchNr");
	if(TheNr.value=="")
	{
		TheNr.focus();
		alert("请输入搜索内容");
	}
	else
	{
		location.href="News_List.asp?tag=Search&TheNr="+TheNr.value;
	}
}
//加入收藏
function addfavorite()
{
   if (document.all)
   {window.external.addFavorite(window.location.href,document.title);}
   else if (window.sidebar)
   {window.sidebar.addPanel(document.title,window.location.href, "");}
   
}
//限制内容图片大小
function resize(o) {
	if (o.width>650) {
	o.style.width='650px';
	o.style.height='auto';
	}
}

function ShowFlash(flashWIDTH,flashHEIGHT,flashURL)
{
document.writeln ('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" WIDTH='+flashWIDTH+' HEIGHT='+flashHEIGHT+'>'); 
document.writeln ('<PARAM NAME=movie VALUE="'+flashURL+'">'); 
document.writeln ('<PARAM NAME=wmode VALUE=transparent>'); 
document.writeln ('<PARAM NAME=loop VALUE=true>'); 
document.writeln ('<PARAM NAME=quality VALUE=high>'); 
document.writeln ('<EMBED src="'+flashURL+'&rad='+Math.random()+'" loop=true wmode=transparent quality=high swLiveConnect=FALSE WIDTH='+flashWIDTH+' HEIGHT='+flashHEIGHT+' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>'); 
document.writeln ('</OBJECT>'); 
}

//新增留言验证
function CkGuestBookAdd(TheForm)
{
	if (TheForm.subject.value=="")
	{
		alert("请输入主题!");
		TheForm.subject.focus();
		return false;
	}
	if (TheForm.nickname.value=="")
	{
		alert("请输入姓名!");
		TheForm.nickname.focus();
		return false;
	}
	if (TheForm.Content.value=="")
	{
		alert("请输入留言内容!");
		TheForm.Content.focus();
		return false;
	}
	if (TheForm.Yzm.value=="")
	{
		alert("请输入验证码!");
		TheForm.Yzm.focus();
		return false;
	}
}
//验证邮箱有效性
function checkemail()
{
	var temp = document.getElementById("tbEmail");
	//对电子邮件的验证
	var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
	if(temp.value!="")
	{
		if(!myreg.test(temp.value))
		{
			alert('提示\n\n请输入有效的E_mail！');
			temp.focus();
			return false;
		}
	}
}
//验证用户注册
function CkUserRegister(TheForm)
{
	if (TheForm.Username.value=="")
	{
		alert("请输入用户名!");
		TheForm.Username.focus();
		return false;
	}
	if (TheForm.UserPass.value=="")
	{
		alert("请输入密码!");
		TheForm.UserPass.focus();
		return false;
	}
	if (TheForm.UserPass.value!=TheForm.UserPass2.value)
	{
		alert("两次输入密码不一致!");
		TheForm.UserPass.focus();
		return false;
	}
	if (TheForm.ReallyName.value=="")
	{
		alert("请输入姓名!");
		TheForm.ReallyName.focus();
		return false;
	}
	if (TheForm.job.value=="")
	{
		alert("请输入职务!");
		TheForm.job.focus();
		return false;
	}
	if (TheForm.phone.value=="")
	{
		alert("请输入电话!");
		TheForm.phone.focus();
		return false;
	}
	if (TheForm.Fax.value=="")
	{
		alert("请输入传真!");
		TheForm.Fax.focus();
		return false;
	}
	if (TheForm.Company.value=="")
	{
		alert("请输入单位!");
		TheForm.Company.focus();
		return false;
	}
	if (TheForm.Department.value=="")
	{
		alert("请输入部门!");
		TheForm.Department.focus();
		return false;
	}
	if (TheForm.address.value=="")
	{
		alert("请输入地址!");
		TheForm.address.focus();
		return false;
	}
}
//验证用户登陆
function CkUserlogin(TheForm)
{
	if (TheForm.Username.value=="")
	{
		alert("请输入用户名!");
		TheForm.Username.focus();
		return false;
	}
	if (TheForm.UserPass.value=="")
	{
		alert("请输入密码!");
		TheForm.UserPass.focus();
		return false;
	}
}
//验证用户修改
function CkUserEdit(TheForm)
{
	if(TheForm.UserPass.value!="" || TheForm.UserPass2.value!="")
	{
		if (TheForm.UserPass.value!=TheForm.UserPass2.value)
		{
			alert("两次输入密码不一致!");
			TheForm.UserPass.focus();
			return false;
		}
	}
	if (TheForm.ReallyName.value=="")
	{
		alert("请输入姓名!");
		TheForm.ReallyName.focus();
		return false;
	}
	if (TheForm.job.value=="")
	{
		alert("请输入职务!");
		TheForm.job.focus();
		return false;
	}
	if (TheForm.phone.value=="")
	{
		alert("请输入电话!");
		TheForm.phone.focus();
		return false;
	}
	if (TheForm.Fax.value=="")
	{
		alert("请输入传真!");
		TheForm.Fax.focus();
		return false;
	}
	if (TheForm.Company.value=="")
	{
		alert("请输入单位!");
		TheForm.Company.focus();
		return false;
	}
	if (TheForm.Department.value=="")
	{
		alert("请输入部门!");
		TheForm.Department.focus();
		return false;
	}
	if (TheForm.address.value=="")
	{
		alert("请输入地址!");
		TheForm.address.focus();
		return false;
	}
}
//验证样品申请
function CkYpsq(TheForm)
{
	if (TheForm.ptype.value=="")
	{
		alert("请输入样品类型!");
		TheForm.ptype.focus();
		return false;
	}
	if (TheForm.pfileds.value=="")
	{
		alert("请输入应用领域!");
		TheForm.pfileds.focus();
		return false;
	}
	if (TheForm.pnumber.value=="")
	{
		alert("请输入预计年用量!");
		TheForm.pnumber.focus();
		return false;
	}
	if (TheForm.Pdate.value=="")
	{
		alert("请输入预计购买时间!");
		TheForm.Pdate.focus();
		return false;
	}
}

//验证在线订购
function CkZxdg(TheForm)
{
	if (TheForm.Product_type.value=="")
	{
		alert("请输入产品型号!");
		TheForm.Product_type.focus();
		return false;
	}
	if (TheForm.pnumber.value=="")
	{
		alert("请输入订购数量!");
		TheForm.pnumber.focus();
		return false;
	}
	if (TheForm.gdate.value=="")
	{
		alert("请输入交货日期!");
		TheForm.gdate.focus();
		return false;
	}
	if (TheForm.gplace.value=="")
	{
		alert("请输入交货地点!");
		TheForm.gplace.focus();
		return false;
	}
	if (TheForm.gway.value=="")
	{
		alert("请输入交货方式!");
		TheForm.gway.focus();
		return false;
	}
}
//验证简历投递
function CkJltd(TheForm)
{
	if (TheForm.UserName.value=="")
	{
		alert("请输入真实姓名!");
		TheForm.UserName.focus();
		return false;
	}
	if (TheForm.tel.value=="")
	{
		alert("请输入联系电话!");
		TheForm.tel.focus();
		return false;
	}
	if (TheForm.Content.value=="")
	{
		alert("请输入自我介绍!");
		TheForm.Content.focus();
		return false;
	}
}
