// JavaScript Document


/*
 * 日期选择框验证
 **/
function checkDateReg(obj) {
	obj.value=obj.value.replace(/\s+/g,'-');
	obj.value=obj.value.replace(/\.+/g,'-');
	var val = obj.value;
	var macRegex = /^[\d]{4}\-(([\d]{2})|([\d]))-(([\d]{2})|([\d]))$/;
	if (val && !macRegex.test(val)) {
		alert('日期格式输入不对！请重新输入。'); 
		obj.focus();
		obj.select();
	}
}
function GetHouseListType( paramName )
{
	var oRegex = new RegExp( '[/]([\w]+)List.php([.]*)', 'i' ) ;
	var oMatch;
	try {
		oMatch = oRegex.exec( window.top.location.search ) ;
	} catch (e) {
	    oMatch = oRegex.exec( location.search ) ;
	}
	
	if ( oMatch && oMatch.length > 1 ){
		return unescape( oMatch[0] ) ;
	} else{
		alert(window.top.location.search);
		return GetUrlParam( paramName );
	}
}

function SetFont(size)
{
  var divBody = document.getElementById("news_content");
  if(!divBody)
  {
	  return;
  }
  divBody.style.fontSize = size + "px";
  var divChildBody = divBody.childNodes;
  for(var i = 0; i < divChildBody.length; i++)
  {
	  if (divChildBody[i].nodeType==1)
	  {
		  divChildBody[i].style.fontSize = size + "px";
	  }
  }
}

function delHouse() {
	document.form1.submit();	
}
ifcheck = true;
function CheckAll(form)
{
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
		e.checked = ifcheck;
	}
	ifcheck = ifcheck == true ? false : true;
}