function $crt(o,t){
	t=document.createElement(t);
	return (typeof(o)=='object')?o.appendChild(t):$(o).appendChild(t);
}
function sendMailTo(name,company,cn){
	this.name=name || 'sales';
	this.company=company || 'zongyi';
	this.cn=cn || 'cn';
	location.replace('mailto:'+this.name+'@'+this.company+'.'+this.cn);
}

function set_bg_fun(){
		var bodyObj=document.getElementsByTagName('body')[0];
		var imgObj=document.getElementById('imgList').getElementsByTagName('img');
		var num=Math.floor(Math.random()*imgObj.length);
		if(imgObj[num].src){
		  var img = imgObj[num].src;
		  img = img.replace('.jpg','_small.jpg');
		  bodyObj.style.background='url('+img+')';
		}else{
			bodyObj.style.background='#ffffff';
		}
}
function set_bg_one_fun(){
		var bodyObj=document.getElementsByTagName('body')[0];
		var imgObj=document.getElementById('productDetail').getElementsByTagName('img');
		if(imgObj[0].src){
		   var str=imgObj[0].src;
		   str=str.replace('.jpg','_small.jpg');
		   bodyObj.style.background='url('+str+')';
		}
}

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 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',
		marginBottom:'20px',
		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>';
}
//set_bg_fun();
