<!--

//pre cache nav images
	
image1 = new Image ()
image1.src="http://www.amfedmtg.com/images/aboutUs_O.gif"

image2 = new Image ()
image2.src="http://www.amfedmtg.com/images/whyChoose_O.gif"

image3 = new Image ()
image3.src="http://www.amfedmtg.com/images/products_O.gif"

image4 = new Image ()
image4.src="http://www.amfedmtg.com/images/onlineApps_O.gif"

image5 = new Image ()
image5.src="http://www.amfedmtg.com/images/BOR_O.gif"

	
	
function rollOver (imgSwap) {
			document[imgSwap].src = "http://www.amfedmtg.com/images/"+imgSwap+"_O.gif"
		
		}

	
function rollOver (imgSwap) {
			document[imgSwap].src = "http://www.amfedmtg.com/images/"+imgSwap+"_O.gif"
		
		}

function rollOut (imgSwap) {
			document[imgSwap].src = "http://www.amfedmtg.com/images/"+imgSwap+".gif"

		}
		
function ImageSelect (imgSwap,beforeAfter) {
			document.clientSample.src = "portfolio/"+imgSwap+".jpg"
			if(beforeAfter=="noBA"){
				document.BA.src = "portfolio/noBA.gif"
				
			} else if (beforeAfter=="yesBA") {
				
				document.BA.src = "portfolio/BA.gif"

			}

		}
		

		


function checkWholeForm(askDesigner) {
    var why = "";
   	why += isEmpty();
    why += checkEmail(askDesigner.email.value);
    why += checkPhone(askDesigner.phone.value);
    if (why != "") {
       alert("All fields are required. Fill in the following "+why);
       return false;
    }
return true;
}
		
// email

function checkEmail (strng) {
var error="";
if (strng == "") {
   error = "\nYou didn't enter an email address.\n";
}

    var emailFilter=/^.+@.+\..{2,3}$/;
    if (!(emailFilter.test(strng))) { 
       error = "\nPlease enter a valid email address.\n";
    }
    else {
//test email for illegal characters
       var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
         if (strng.match(illegalChars)) {
          error = "\nThe email address contains illegal characters.\n";
       }
    }
return error;    
}


// phone number - strip out delimiters and check for 10 digits

function checkPhone (strng) {
var error = "";
if (strng == "") {
   error = "\nYou didn't enter a phone number.\n";
}

var stripped = strng.replace(/[\(\)\.\-\ ]/g, ''); //strip out acceptable non-numeric characters
    if (isNaN(parseInt(stripped))) {
       error = "\nThe phone number contains illegal characters.";
  
    }
    if (!(stripped.length == 10)) {
	error = "\nThe phone number is the wrong length. Make sure you included an area code.\n";
    } 
return error;
}



function isEmpty() {
var error = "";
  if (document.theForm.name.value=="") {
     error += "Name"
  }
   if (document.theForm.address.value=="") {
     error += " Address"
  }
  if (document.theForm.city.value=="") {
     error += " City"
  }
  if (document.theForm.state.value=="") {
     error += " State"
  }
  if (document.theForm.zip.value=="") {
     error += " Zip"
  }
  if(document.theForm.Question){
 	 if (document.theForm.Question.value=="") {
   	  error += " Question"
 	 }
 } 
 if(document.theForm.username){
 	 if (document.theForm.username.value=="") {
   	  error += " Username"
 	 }
  }
  
 if(document.theForm.password){
 	 if (document.theForm.password.value=="") {
   	  error += " Password"
 	 }
  }  
  error+=""
return error;	  
}

//zip code



// End hiding script from old browsers -->