// JavaScript Document
//左侧导航菜单背景
function o(object,f){
	object.background="images/dh_bg2.gif";
	f.style.color="#FFFFFF";
}
function c(object,f){
	object.background="";
	f.style.color="#797979";
}
//详细查看按钮图片
function oa(object){
	object.src="../images/btn/btn_xh_2.gif";
}
function ca(object){
	object.src="../images/btn/btn_xh.gif"; 
}
//产品类别文字背景
function op(object){
	object.style.background="#FFFFFF";
}
function cp(object){
	object.style.background="#F5F5F5";
}
//弹出窗口函数
function imeWin(file,w,h){
   window.open(file,'','resizable=yes,width='+w+",height="+h+',scrollbars=yes,left='+(screen.availWidth-w)/2+',top='+(screen.availHeight-h)/2);
}

//会员框检测
	function CheckForm()
	{
		if(document.UserLogin.UserName.value=="")
		{
			alert("请输入用户名！");
			document.UserLogin.UserName.focus();
			return false;
		}
		if(document.UserLogin.Password.value == "")
		{
			alert("请输入密码！");
			document.UserLogin.Password.focus();
			return false;
		}
	}

//改变字体大小
function fontZoom(size){
 document.getElementById('fontZoom').style.fontSize=size+'px'
}

//滚动内容
var currentpos,timer;

function initialize()
{
timer=setInterval("scrollwindow()",50);
}
function sc(){
clearInterval(timer);
}
function scrollwindow()
{
currentpos=document.body.scrollTop;
window.scroll(0,++currentpos);
if (currentpos != document.body.scrollTop)
sc();
}
document.onmousedown=sc
document.ondblclick=initialize

//检测留言表单
  


//函数名：chkemail     
//功能介绍：检查是否为Email Address     
//参数说明：要检查的字符串     
//返回值：0：不是 1：是    
function chkemail(a)     
{ 
var i=a.length;     
var temp = a.indexOf('@');     
var tempd = a.indexOf('.');     
if (temp > 1) {     
if ((i-temp) > 3){     
if ((i-tempd)>0){     
return 1;     
}         
}     
}     
return 0;     
}     

function checkfrm(){
if(document.postfrm.ftype.value==""){
alert("请选择留言类别！");
document.postfrm.ftype.focus();
return false;
}	
	
if(document.postfrm.Receiver.value==""){
alert("请输入联系人姓名！");
document.postfrm.Receiver.focus();
return false;
}

if(document.postfrm.Email.value!=0){ 
if(chkemail(document.postfrm.Email.value)==0){
alert("请输入正确的Email！");
document.postfrm.Email.focus();
return false;
}
}
else   
      {   
        alert("请输入Email地址！");   
        document.postfrm.Email.focus();   
        return   false;   
        }

if(document.postfrm.province.value==""){
alert("请选择省份！");
document.postfrm.province.focus();
return false;
}

if(document.postfrm.Add.value==""){
alert("请输入联系地址！");
document.postfrm.Add.focus();
return false;
}
if(document.postfrm.Phone.value==""){
alert("请输入联系电话！");
document.postfrm.Phone.focus();
return false;
}
if(document.postfrm.CompanyName.value==""){
alert("请输入公司名称！");
document.postfrm.CompanyName.focus();
return false;
}

if(document.postfrm.Title.value==""){
alert("请输入主题!");
document.postfrm.Title.focus();
return false;
}
if(document.postfrm.content.value==""){
alert("请输入留言内容！");
document.postfrm.content.focus();
return false;
}
}

//会员注册

function checkreg()
{
  if (document.UserReg.UserName.value=="")
	{
	alert("请输入用户名！");
	document.UserReg.UserName.focus();
	return false;
	}
  else
    {
	document.reg.username.value=document.UserReg.UserName.value;
	var popupWin = window.open('UserCheckReg.asp', 'CheckReg', 'scrollbars=no,width=340,height=200');
	document.reg.submit();
	}
}




