


//此处为string类添加三个成员
String.prototype.Trim = function() { return this.replace(/(^\s*)|(\s*$)/g, ""); }         
String.prototype.LTrim = function(){ return this.replace(/(^\s*)/g, "");}
String.prototype.RTrim = function(){ return this.replace(/(\s*$)/g, "");} 


// JavaScript Document
function checkform () {
	if ( isNull ('companyname' , '公司名称') ) { return false ;}
	if ( isNull ('postcode' , '邮编') ) { return false ;}
	if ( isNull ('username' , '联系人') ) { return false ;}
	if ( isNull ('address' , '详细地址') ) { return false ;}
	if ( isNull ('job' , '职务') ) { return false ;}
	if ( isNull ('website' , '网站') ) { return false ;}
	if ( isNull ('telephone' , '电话') ) { return false ;}
	if ( isNull ('staffSize' , '人员规模') ) { return false ;}
	if ( isNull ('fax' , '传真') ) { return false ;}
	if ( isNull ('range' , '销售收入') ) { return false ;}
	if ( isNull ('email' , 'E_mail') ) { return false ;}
	if ( isNull ('business' , '主营业务') ) { return false ;}
	if ( isNull ('content' , '需求描述') ) { return false ;}
	
	return true ;
}


function isNull (id , msg) {
	var obj = document.getElementById(id);
	var value = obj.value.Trim() ;
	
	if (value == "" ) {
		 alert(msg + "不能为空!.");	
		 return true ;
		 
	}
	
	return false
}
