function ClearCookies()
{
			setCookie("zipCode","");
			setCookie("zipLatitude","");
			setCookie("zipLongitude","");
			setCookie("searchRadius","");
}




// Sets cookie values. Expiration date is optional
function setCookie(name, value, expire) 
{   
	document.cookie = name + "=" + escape(value)   + ((expire == null) ? "" : ("; 	expires=" + expire.toGMTString()))
}




// returns a cookie value, given the name of the cookie:
function getCookie(Name) 
{   
	var search = Name + "="   
	if (document.cookie.length > 0) 
	{ // if there are any cookies      
		offset = document.cookie.indexOf(search)       
		if (offset != -1) 
		{ // if cookie exists          
			offset += search.length          // set index of beginning of value
			end = document.cookie.indexOf(";", offset)          // set index of end of cookie value         
			if (end == -1)             
				end = document.cookie.length         
			return unescape(document.cookie.substring(offset, end))      
		}
    }
}


function parsePhone(num)
{
	res = "(" + num.substring(0,3) + ")" + num.substring(3,6) + "-" + num.substring(6,10);
	return  res;
}

function alterColor(num)
{
	if (num%2 == 1)
	{
		return "#f9f9f9";
	}
	else
	{
		return "#eeeeee";
	}
}

function countyLetter2Name(let)
{
	if (let=="A") return "Atlantic county";
	if (let=="B") return "Bergen county";
	if (let=="C") return "Burlington county";
	if (let=="D") return "Camden county";
	if (let=="E") return "Cape May county";
	if (let=="F") return "Cumberland county";
	if (let=="G") return "Essex county";
	if (let=="H") return "Gloucester county";
	if (let=="J") return "Hudson county";
	if (let=="K") return "Hunterdon county";
	if (let=="L") return "Mercer county";
	if (let=="M") return "Middlesex county";
	if (let=="N") return "Monmouth county";
	if (let=="P") return "Morris county";
	if (let=="Q") return "Ocean county";
	if (let=="R") return "Passaic county";
	if (let=="S") return "Salem county";
	if (let=="T") return "Somerset county";
	if (let=="V") return "Sussex county";
	if (let=="W") return "Union county";
	if (let=="Y") return "Warren county";
	return "";
} 

