// JavaScript Document
function checkform(){
    var title = RemoveHTML(document.form1.title.value.Trim());
	var type = RemoveHTML(document.form1.type.value.Trim());
	var location = RemoveHTML(document.form1.location.value.Trim());
	var road_location = RemoveHTML(document.form1.road_location.value.Trim());
	var address = RemoveHTML(document.form1.address.value.Trim());
	if(title==""){
		alert('标题不能为空！');
		document.form1.title.focus;
		return false;
	}
	if(type==""){
		alert('物业类型不能为空！');
		document.form1.type.focus;
		return false;
	}
	if(location==""){
		alert('地区不能为空！');
		document.form1.location.focus;
		return false;
	}
	if(road_location==""){
		alert('线路位置不能为空！');
		document.form1.road_location.focus;
		return false;
	}
	if(address==""){
		alert('地址不能为空！');
		document.form1.address.focus;
		return false;
	}
	
	return true;
}


function RemoveHTML( strText ){
    strText = removeJS(strText);
    var regEx = /<[^>]*>/g;
	var regEx2 = /<!--[^-]*-->/g;
    return strText.replace(regEx2,"").replace(regEx,"");
  }
  
  function removeJS(strText) {
    
	var str = strText;
	while(str.indexOf("<script")!=-1){
	    var start = str.indexOf("<script");
	    var end = str.indexOf("/script>")+8;
	    str = str.substring(0,start)+str.substring(end,str.length);
	};
	return str;
  }
  
  function String.prototype.Trim() {return this.replace(/(^\s*)|(\s*$)/g,"");}
  function String.prototype.Ltrim(){return this.replace(/(^\s*)/g, "");}
  function String.prototype.Rtrim(){return this.replace(/(\s*$)/g, "");}
  
  
  
