var moyaIconString = "/theme/ie/images/realestate/mapicon/icon_green.gif";
var moyaIconStringNew = "/theme/ie/images/realestate/mapicon/icon_new.gif";
var moyaSubwayIconString = "/theme/ie/images/realestate/mapicon/icon_subway.gif";
var moyaSchoolIconString = "/theme/ie/images/realestate/mapicon/icon_school.gif";
function getMoyaIcon(isNew) {
	if(isNew == "true") {
		return "/theme/ie/images/realestate/mapicon/icon_new.png";
	}else {
		return "/theme/ie/images/realestate/mapicon/green.png";
	}
}

function getMoyaSubwayIcon() {
	var moyaIcon = new GIcon();
	moyaIcon.image = "/theme/ie/images/realestate/mapicon/icon_subway.png";
	moyaIcon.iconSize = new GSize(31, 38);
	moyaIcon.shadow = "/theme/ie/images/realestate/mapicon/shadow.png";
	moyaIcon.shadowSize = new GSize(27, 37);
	moyaIcon.iconAnchor = new GPoint(15, 37);
	moyaIcon.infoWindowAnchor = new GPoint(15, 1);
	return moyaIcon;
}

function getMoyaSchoolIcon() {
	var moyaIcon = new GIcon();
	moyaIcon.image = "/theme/ie/images/realestate/mapicon/icon_school.png";
	moyaIcon.iconSize = new GSize(31, 38);
	moyaIcon.shadow = "/theme/ie/images/realestate/mapicon/shadow.png";
	moyaIcon.shadowSize = new GSize(27, 37);
	moyaIcon.iconAnchor = new GPoint(15, 37);
	moyaIcon.infoWindowAnchor = new GPoint(15, 1);
	return moyaIcon;
}
function closeWindow(wid) {
	$(wid).style.display = "none";
}
function openWindow(wid) {
	$(wid).style.display = "";
}
function strTrim(str) {
	if (str == null) {
		return "";
	}
	return str.replace(/^\s*|\s*$/g,"");
}
function checkHousingKeyWords() {
	var keyWords = strTrim($("housingKeyWords").value);
	if(keyWords == null || keyWords.length == 0 || keyWords == "请输入小区名称或房源编号(例如:C123)") {
		$("keywordsError").style.display = "";
		return false;
	}
	$("keywordsError").style.display = "none";
	return true;
}
function enterKey() {
	if(window.event.keyCode==13){
		window.event.returnValue=false;
   		window.event.cancel = true;
		$("currentPageForm").submit();
	}
	return false;
}
function isEnterKey() {
	if(window.event.keyCode==13){
		window.event.returnValue=false;
   		window.event.cancel = true;
   		return true;
	}
	return false;
}
function isNumber(value) {
  	var patn = /^[-\+]?([1-9]{1}[0-9]*)$/;
	return patn.test(value);
}
function isEmpty(value){
	 var result = value.replace(/(^\s*)|(\s*$)/g, "");
	 return result=='';
}
function isDouble(value){
  	 var patn = /^([1-9]{1}\d*)(\.?)(\d*)$/;
	 return patn.test(value);
}
function isTwoDimensionDouble(value) {
	var patn = /^([1-9]{1}\d*)(\.?)(\d{1,2})$/;
	return patn.test(value);
}
function isMobilePhone(value) { 
//	var patn=/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/; 
	var patn=/^(\d){8,11}$/;
	return patn.test(value);
}
function isDate(value) {
	var patn = /^\d{4}-(0?[1-9]|1[0-2])-(0?[1-9]|[1-2]\d|3[0-1])$/;
	return patn.test(value);
 }
