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');
		if(imgObj){
			imgObj = imgObj.getElementsByTagName('img');
			if(imgObj.length > 1){
			    var num=Math.ceil(Math.random()*imgObj.length);
			}else{
				var num = 0;

			}
			var imgUrl = imgObj[num].src;
			bodyObj.style.background='url('+imgUrl+')';
		}
}
function set_bg_one_fun(str){
	    var bodyObj=document.getElementsByTagName('body')[0];
	    if(str!=''){
		   str = str.replace('.jpg','-small.jpg');
		   bodyObj.style.background='url('+str+')';
		}
		var bodyObj=document.getElementsByTagName('body')[0];
		var imgObj=document.getElementById('imgDetail').getElementsByTagName('img');
		if(imgObj.src){
		   var str=imgObj.src.replace('.jpg','-small.jpg');
		   imgObj[0].style.width=imgObj[0].offsetWidth>460 ? '460px':imgObj[0].offsetWidth+'px';
		   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();
