
function openWin( windowURL, windowName, windowFeatures) 
{ 
	return window.open( windowURL, windowName, windowFeatures ) ; 
} 

function isMLNUM(obj)
{
	var re = /([^0-9]){1,}/g;

	if (re.test(obj.value) == true)
	{
		alert('The format of your MLS number appears to be incorrect.  The proper format is digital');
		obj.value = '';
		obj.select();
		return false;
	}	
	
	return true;
}

function isZipCode(obj)
{
	var re = /([0-9]){5}/g;

	if (re.test(obj.value) == false && obj.value!='')
	{
		alert('The format of the Zip Code you entered appears to be incorrect.  The proper format is: 77002');
		obj.value = '';
		obj.select();
		return false;
	}	
	
	return true;
}

function isNumeric(obj, descr)
{
	var re = /([^0-9]){1,}/g;

	if (re.test(obj.value) == true)
	{
		alert('The value, "' + obj.value + '", you entered for ' + descr + ' is not a number.  Please enter a number.');
		obj.value = '';
		obj.focus();
		return false;
	}	
}

function fnCompareRangeValues(objMin, objMax, descrMin, descrMax)
{
	if (parseInt(objMin.value) > parseInt(objMax.value))
	{
		alert('The value you entered for ' + descrMin + ' is greater than the value you entered for ' + descrMax + '.');
		return false;
	}

	return true;
}

function fnClearFormObjects(frm)
{
	for(x=1; x < arguments.length; x++)
	{
	
		if (arguments[x].type == 'checkbox')
		{
			arguments[x].checked = false;
		}
		else if (arguments[x].type == 'select-multiple')
		{
			arguments[x].selectedIndex = 0;
		}
		else
		{
			arguments[x].value = '';
		}
		
	}
}

function validChar(strInput){
	var j;
	for(j=0; j<strInput.length; j++){
		x = strInput.charAt(j);
		if ( (x > "z") || 
				(x > "Z" && x < "a") ||
				(x > "9" && x < "A") || 
				( (x<"0") && !(x =="," || x ==" " || x=="-"|| x=="'") )
			)
		{
			return false;
		}
	}
	return true;
}
