function checkform() { var wherecheck = 1;
  for (i=0;i<1;i++)
    if (document.form1.services.value == '') {alert ('Please select a dental specialty');}
    else if (document.form1.zip.value == '') {alert ('Please enter an area code');}
    else {
		if(isNumberString(document.form1.zip.value))  {
			if((document.form1.zip.value.length != 3) && (document.form1.zip.value.length != 5)) {
				alert('The zip or area code you entered is invalid: ');
			} else {
				document.form1.submit();
			}
		} else {
			alert('The zip code you entered is invalid');
		}
	}
}

function isNumberString (InString)  {
    if(InString.length==0) return (false);
    var RefString="1234567890";
    for (Count=0; Count < InString.length; Count++)  {
        TempChar= InString.substring (Count, Count+1);
        if (RefString.indexOf (TempChar, 0)==-1)  
            return (false);
    }
    return (true);
}


imgout=new Image(9,9);
imgin=new Image(9,9);

imgout.src="/images/u.gif";
imgin.src="/images/d.gif";


//this switches expand collapse icons
function filter(imagename,objectsrc){
	if (document.images){
		document.images[imagename].src=eval(objectsrc+".src");
	}
}

//show OR hide funtion depends on if element is shown or hidden
function shoh(id) { 
	
	if (document.getElementById) { // DOM3 = IE5, NS6
		if (document.getElementById(id).style.display == "none"){
			document.getElementById(id).style.display = 'block';
			filter(("img"+id),'imgin');			
		} else {
			filter(("img"+id),'imgout');
			document.getElementById(id).style.display = 'none';			
		}	
	} else { 
		if (document.layers) {	
			if (document.id.display == "none"){
				document.id.display = 'block';
				filter(("img"+id),'imgin');
			} else {
				filter(("img"+id),'imgout');	
				document.id.display = 'none';
			}
		} else {
			if (document.all.id.style.visibility == "none"){
				document.all.id.style.display = 'block';
			} else {
				filter(("img"+id),'imgout');
				document.all.id.style.display = 'none';
			}
		}
	}
}

