function Form_Validator(theForm)
{
  var checkOK = "0123456789-,";
  var checkStr = theForm.ZipCode.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch != ",")
      allNum += ch;
  }

  if (theForm.State.selectedIndex == 0)
  {
    if ((theForm.ZipCode.value == "") || (theForm.ZipCode.value == "Zip Code") || (!allValid))
    {
   	alert("Please choose a state or enter a Zip Code.");
	theForm.State.focus();
	return (false);
    }
  }
  return (true);
}
function SForm_Validator(theForm)
{
  var checkOK = "0123456789-,";
  var checkStr = theForm.Zip.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch != ",")
      allNum += ch;
  }

  if (theForm.State.selectedIndex == 0)
  {
    if ((theForm.Zip.value == "") || (theForm.Zip.value == "Zip Code") || (!allValid))
    {
   	alert("Please choose a state or enter a Zip Code.");
	theForm.State.focus();
	return (false);
    }
  }
  return (true);
}

//Variables
var scrollerwidth=140;
var scrollerheight=160; 
var scrollerbgcolor='#7DC622'; 
var scrollerbackground='';  
//contents of the scroller 
var messages=new Array();  
messages[1]="<table cellpadding='2' border='0' align=center><tr><td><img SRC='http://www.usdiners.com/images/affilliate/giftscom.gif' BORDER='0' WIDTH='125' HEIGHT='125' ALT></td></tr><tr><td class=SlideText></td></tr></table>"; 
messages[2]="<table cellpadding='2' border='0' align=center><tr><td><a HREF='http://click.linksynergy.com/fs-bin/stat?id=*nu7uHqrL3I&amp;offerid=19247.42&amp;type=4&amp;subid=0' TARGET='_blank'><img src='http://www.usdiners.com/images/affilliate/cookingcom.gif' WIDTH='125' HEIGHT='125' border='0'></a></td></tr><tr><td class=MenuTitle></td></tr></table>"; 
messages[3]="<table cellpadding='2' border='0' align=center><tr><td><a href='http://click.linksynergy.com/fs-bin/click?id=*nu7uHqrL3I&offerid=31219.10000023&subid=0&type=4' TARGET='_blank'><IMG border='0'  width='125' height='125'   alt='Banner 10000023' src='http://www.usdiners.com/images/affilliate/alazing.jpg'></a></td></tr><tr><td class=SlideText></td></tr></table>"; 
messages[0]="<table cellpadding='2' border='0' align=center><tr><td><a href='becomemember.shtml'><img src='http://www.usdiners.com/images/logo4.gif'></a></td></tr><tr><td class=MenuTitle align=center><nobr><b><font color=blue>Welcome!</font></b></nobr></td></tr></table>";  
if (messages.length>1) 
	i=2; 
else 
	i=0;  

function move1(whichlayer){ 
	tlayer=eval(whichlayer); 
	if (tlayer.left>0&&tlayer.left<=5){ 
		tlayer.left=0; 
		setTimeout("move1(tlayer)",5000); 
		setTimeout("move2(document.main.document.second)",5000); 
		return; 
	} 
	if (tlayer.left>=tlayer.document.width*-1){ 
		tlayer.left-=5; 
		setTimeout("move1(tlayer)",100); 
	} 
	else{ 
		tlayer.left=scrollerwidth+2; 
		tlayer.document.write(messages[i]); 
		tlayer.document.close(); 
	if (i==messages.length-1) 
		i=0; 
	else 
		i++; 
	} 
}  
function move2(whichlayer){ 
	tlayer2=eval(whichlayer); 
	if (tlayer2.left>0&&tlayer2.left<=5){ 
		tlayer2.left=0; 
		setTimeout("move2(tlayer2)",5000); 
		setTimeout("move1(document.main.document.first)",5000); 
		return; 
	} 
	if (tlayer2.left>=tlayer2.document.width*-1){ 
		tlayer2.left-=5; 
		setTimeout("move2(tlayer2)",100); 
	} 
	else{ 
		tlayer2.left=scrollerwidth+2; 
		tlayer2.document.write(messages[i]); 
		tlayer2.document.close(); 
		if (i==messages.length-1) 
			i=0; 
		else 
			i++; 
	} 
}  
function move3(whichdiv){ 
	tdiv=eval(whichdiv); 
	if (tdiv.style.pixelLeft>0&&tdiv.style.pixelLeft<=5){ 
		tdiv.style.pixelLeft=0; 
		setTimeout("move3(tdiv)",5000); 
		setTimeout("move4(second2)",5000); 
		return; 
	} 
	if (tdiv.style.pixelLeft>=tdiv.scrollWidth*-1){ 
		tdiv.style.pixelLeft-=5; 
		setTimeout("move3(tdiv)",100);
	} 
	else{ 
		tdiv.style.pixelLeft=scrollerwidth; 
		tdiv.innerHTML=messages[i]; 
		if (i==messages.length-1) 
			i=0; 
		else 
			i++; 
	} 
}  
function move4(whichdiv){ 
	tdiv2=eval(whichdiv); 
	if (tdiv2.style.pixelLeft>0&&tdiv2.style.pixelLeft<=5){ 
		tdiv2.style.pixelLeft=0; 
		setTimeout("move4(tdiv2)",5000); 
		setTimeout("move3(first2)",5000); 
		return; 
	} 
	if (tdiv2.style.pixelLeft>=tdiv2.scrollWidth*-1){ 
		tdiv2.style.pixelLeft-=5; 
		setTimeout("move4(second2)",100); 
	} 
	else{ 
		tdiv2.style.pixelLeft=scrollerwidth; 
		tdiv2.innerHTML=messages[i]; 
		if (i==messages.length-1) 
			i=0; 
		else 
			i++; 
	} 
}  
function startscroll(){ 
	if (document.all){ 
		move3(first2); 
		second2.style.left=scrollerwidth; 
		second2.style.visibility='visible'; 
	} 
	else if (document.layers){ 
		document.main.visibility='show'; 
		move1(document.main.document.first); 
		document.main.document.second.left=scrollerwidth+5; 
		document.main.document.second.visibility='show'; 
	} 
}
		layerRef = "";
		styleRef = "";
		if (navigator.appName == "Netscape")
		{
			layerRef = ".layers";
			styleRef = "";
		}
		else
		{
			layerRef = ".all";
			styleRef = ".style";
		}	

		function ShowLayer(layerName)
		{
			eval("document" + layerRef + "[layerName]" + styleRef + ".visibility = 'visible'")	;
		}
		function HideLayer(layerName)
		{
			eval("document" + layerRef + "[layerName]" + styleRef + ".visibility = 'hidden'")	;
		}

function ConvertPhone(Field)
{
t2=Field.value;
var t= new String();
for(i=0;i < t2.length;i++) { 
	if ((!isNaN(t2.charAt(i))) && (t2.charAt(i) != ' '))
		t=t+t2.charAt(i).toString();
} 
if (t.length < 10) {
	alert('Please check your Phone number '+t2);
	return false;
}

Field.value='('+t.substring(0,3)+') '+t.substring(3,6)+'-'+t.substring(6,10);
// alert('Phone number converted to: '+Field.value);
return true;
}

function focusField(name) {
  for(var i = 0; i < document.forms.length; ++i) {
    var obj = document.forms[i].elements[name];
    if (obj) {
      if (obj.length) { obj = obj[0]; }
      if (obj.focus) { obj.focus(); }
    }
  }
}

