
function home_onresize(e) {
	if (!e) var e = window.event;
 
    JustifyMenu(40);
	var lw;w=137;nw=1;tw=4;mx=10;mn=2; var ww = winwidth(); var sw = 190;
	lw =(navigator.appName.indexOf('Microsoft')!=-1)?395:412; //account for slightly different screen widths
	n=(Math.floor((ww-lw)/(w))+1);
	if (mn>n)n=mn;
	if (n>mx)n=mx;
	var fr; var rr;
	var cont = document.getElementById("favorite_thai_recipes");
	var rs = document.getElementById("new_recipes");
	if(navigator.appName.indexOf('Microsoft')!=-1){
		for(var a=0; (n-1)>=a; a++){eval("Fav_recipe_"+a).style.display="";}
		if (mx>n){for(var b=n;(mx-1)>=b;b++){eval("Fav_recipe_"+b).style.display="none";}}
		cont.style.width = ww-sw;
		}
	else
	  {//ff
		for(var a=0; (n-1)>=a; a++){
		fr = document.getElementById("Fav_recipe_"+a);
		fr.style.display="";}
		if (mx>n){for(var b=n;(mx-1)>=b;b++){
		fr = document.getElementById("Fav_recipe_"+b);
		fr.style.display="none";}}}}
	


//make sure that Zip or city exists for non-US
  function validateFormIntl(form)
  {
    var country = document.getElementById("strCountry");
    var city = document.getElementById("strCity");
    var state  = document.getElementById("strState");
    var zip = document.getElementById("strZipCode");

	if ((country.value == "Other")||(country.value == "USA")) return true;	
	if (zip.value==""){
		if (city.value=="") return false;//intl needs city
		return true;}
	else
		return true;
  }
// make sure that the zip or (city,ST) is in for the US
  function validateFormUS(form)
  {
    var country = document.getElementById("strCountry");
    var city = document.getElementById("strCity");
    var state  = document.getElementById("strState");
    var zip = document.getElementById("strZipCode");
	if (country.value == "USA")
		{
		if (zip.value==""){
			if (city.value=="") return false; //US needs city and state
			if (state.value=="") return false;
			}
		else
			if (isNotUSZipCode(zip)) return false;
		}
   return true;
  }
//check to make sure that the zip code is at least 5 digits long (zip codes can be 5 or 9 digits long) and is all numbers
  function isNotUSZipCode(TextControl)
	{ var result= (TextControl.value.match(/^\d{5}/)==null)
	return result;
	}
