addLoadEvent(subConPicWidth);
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {  
    window.onload = function() {
      oldonload();
      func();
    }
  }
}
function sendMailTo(name, company, cn) {
      locationstring = 'mai' + 'lto:' + name + '@' + company + '.' + cn;
      window.location.replace(locationstring);
   }

function CheckPosts()
{
 if(document.form1.FKname.value=="")
 {
  alert("Please enter the  Name, thanks! ");
  document.form1.FKname.focus();
  return false;
  }
 if(document.form1.FKphone.value=="")
 {
  alert("Please enter the phone, thanks! ");
  document.form1.FKphone.focus();
  return false;
  }
   if(document.form1.FKemail.value=="")
 {
  alert("Please enter the email, thanks! ");
  document.form1.FKemail.focus();
  return false;
  }
   if(document.form1.FKtitle.value=="")
 {
  alert("Please enter the title, thanks! ");
  document.form1.FKtitle.focus();
  return false;
  }  

   if(document.form1.FKmessage.value=="")
 {
  alert("Please enter the message, thanks! ");
  document.form1.FKmessage.focus();
  return false;
  } 
  return true;
}

function CheckPosts_2()
{
 if(document.form2.Name.value=="")
 {
  alert("Please enter the  Name, thanks! ");
  document.form2.Name.focus();
  return false;
  }
   if(document.form2.Email.value=="")
 {
  alert("Please enter the email, thanks! ");
  document.form2.Email.focus();
  return false;
  }  
 if(document.form2.Phone.value=="")
 {
  alert("Please enter the phone, thanks! ");
  document.form2.Phone.focus();
  return false;
  }

   if(document.form2.Address.value=="")
 {
  alert("Please enter the Address, thanks! ");
  document.form2.Address.focus();
  return false;
  }

   if(document.form2.City.value=="")
 {
  alert("Please enter the City, thanks! ");
  document.form2.City.focus();
  return false;
  } 
  
   if(document.form2.Province.value=="")
 {
  alert("Please enter the Province, thanks! ");
  document.form2.Province.focus();
  return false;
  }

   if(document.form2.Country.value=="")
 {
  alert("Please enter the Country, thanks! ");
  document.form2.Country.focus();
  return false;
  }      

   if(document.form2.Content.value=="")
 {
  alert("Please enter the Content, thanks! ");
  document.form2.Content.focus();
  return false;
  } 
  return true;
}
function subConPicWidth(){
	var obj=document.getElementById('main').getElementsByTagName('div');
	if(obj){
	for(var i=0,j=obj.length;i<j;i++){
		if(obj[i].className=='subCon'){
				var imgObj=obj[i].getElementsByTagName('img')[0];
				imgObj.style.width=imgObj.width>450?'450px':imgObj.width+'px'
		}
	}
	}
}
function $crt(o,t){
	t=document.createElement(t);
	return (typeof(o)=='object')?o.appendChild(t):$(o).appendChild(t);
}
function zh(){
	var bo=document.body || document.documentElement;
	var div1=bo.getElementsByTagName('div')[0];
	var createObj=document.createElement('div');
	var newObj=bo.insertBefore(createObj,div1);
	var newObjStyle={
		clear:'both',
		height:'58px',
		marginTop:'-13px',
		marginBottom:'13px',
		textAlign:'center',
		background:'url(/images/zhanhui_bg.gif) repeat-x'
	}
	for(var i in newObjStyle){
		newObj.style[i]=newObjStyle[i];	
	}
	newObj.innerHTML='<a href=http://www.zongyi.cn/2010.html><img src=/images/zhanhui.jpg /></a>';
}
