function mcolor(stable){
	if (isNaN(stable)){
	}
	else{
		document.getElementById("table" +stable).bgColor="#E9EDF5";
	}
}
function check(e1){
	if (e1.name.value == ""){
		msgopen('姓名项不可为空，请认真填写。');
		return false;
	}
	if (e1.tel.value == ""){
		msgopen('联系电话不可为空，请认真填写.');
		return false;
	}
	if (!IfTel(e1.tel.value) || e1.tel.value.length < 7 ){
		msgopen('联系电话格式不正确，请认真填写。');
		return false;
	}
	if (e1.fax.value != ""  ){
		if (!IfTel(e1.fax.value) || e1.fax.value.length < 7 || e1.fax.value.length > 17  ){
			msgopen('传真号码格式不正确，该项可留空，不留空请认真填写。');
			return false;
		}
	}
	if (e1.email.value == "" || e1.email.value.indexOf("@") == -1 || e1.email.value.split("@").length > 2 || e1.email.value.indexOf(".") == - 1){
		msgopen('电子信箱不可为空，请按格式认真填写。');
		return false;
	}
	if (e1.content.value == ""){
		msgopen('请您填写留言内容。');
		return false;
	}
}
function msgclose(msgalt){
		msg01.style.display='none';
		msg02.style.display='none';
		document.all.msgtitle.innerHTML = msgalt 
	}
function msgopen(msgalt){
	msg01.style.display='';
	msg02.style.display='';
	document.all.msgtitle.innerHTML = msgalt 
}

function IfTel(String)
{
	var Letters = "0123456789-/()+*:";
     	var i;
     	var c;
      	if(String.charAt( 0 )=='-')
			return false;
      	if( String.charAt( String.length - 1 ) == '-' )
			return false;
     	for( i = 0; i < String.length; i ++ ){
			c = String.charAt( i );
		if (Letters.indexOf( c ) < 0)
			return false;
     	}
     	return true;
}

